# ActiveRecord automatic quoted identifiers

**URL:** <https://www.ruby-forum.com/t/activerecord-automatic-quoted-identifiers/97034>\
**Category:** Ruby\
**Created:** [January 25, 2006, 6:14am UTC](https://www.ruby-forum.com/t/activerecord-automatic-quoted-identifiers/97034 "2006-01-25T06:14:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/82dd89/32.png) [@jeremy](https://www.ruby-forum.com/u/jeremy)\
**Post date:** [January 25, 2006, 6:14am UTC](https://www.ruby-forum.com/t/activerecord-automatic-quoted-identifiers/97034/1 "2006-01-25T06:14:35Z")

</div>

Is there a way to tell ActiveRecord to automatically quote all  
table/column/etc. identifiers in the SQL that it generates? I just  
upgraded to MySql 5 and we have a database table named “Release”…  
This is a new reserved word. Bummer.

I want ActiveRecord to automatically generate SQL like:

SELECT `name` FROM `Release`  
instead of:  
SELECT name FROM Release

I can use ActiveRecord::Base#set\_table\_name to deal with this  
particular case but it seems like a bit of a hack. Anyone know if  
there’s a global setting for this in database.yml or something?

Jeremy

---

<div class="post-metadata">

**Author:** ![jeremy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/82dd89/32.png) [@jeremy](https://www.ruby-forum.com/u/jeremy)\
**Post date:** [January 25, 2006, 3:40pm UTC](https://www.ruby-forum.com/t/activerecord-automatic-quoted-identifiers/97034/2 "2006-01-25T15:40:54Z")

</div>

“Jeremy” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> I can use ActiveRecord::Base#set\_table\_name to deal with this  
> particular case but it seems like a bit of a hack. Anyone know if  
> there’s a global setting for this in database.yml or something?

+1. I was once bitten by using the PostgreSQL reserved word “user” as  
column name, which is the _only_ function that can be called without  
parentheses. _sigh_.
