ActiveRecord for PostgreSQL

By default ActiveRecord always quote table name for the generated SQL.
For example set_table_name 'CUSTOMER_ACCOUNT'
Then it generate sql like , SELECT * FROM "CUSTOMER_ACCOUNT"
This is an issue for the PostgreSQL database which gives table doesn't
exist error.
How could generate a sql using ActiveRecord without quotes?

···

--
Posted via http://www.ruby-forum.com/.

in postgres table name (in general name of every db objects)
is case insensitive, but if you use "" to quote string postgres
become case sensitive.

to make a long story short use lower case in your model i.e.

set_table_name 'my_table'

···

On Wed, Apr 10, 2013 at 9:08 PM, Biju jaaaa <lists@ruby-forum.com> wrote:

By default ActiveRecord always quote table name for the generated SQL.
For example set_table_name 'CUSTOMER_ACCOUNT'
Then it generate sql like , SELECT * FROM "CUSTOMER_ACCOUNT"
This is an issue for the PostgreSQL database which gives table doesn't
exist error.
How could generate a sql using ActiveRecord without quotes?

--
Posted via http://www.ruby-forum.com/\.

Isn't that an issue about UPER_CASE_NAME? What if you do:

set_table_name 'customer_account'

?

Btw, this is more related to Rails guys than to Ruby ones.

···

Em Qui, 2013-04-11 às 04:08 +0900, Biju jaaaa escreveu:

By default ActiveRecord always quote table name for the generated SQL.
For example set_table_name 'CUSTOMER_ACCOUNT'
Then it generate sql like , SELECT * FROM "CUSTOMER_ACCOUNT"
This is an issue for the PostgreSQL database which gives table doesn't
exist error.
How could generate a sql using ActiveRecord without quotes?

--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.br
http://www.rnp.br/keyserver/pks/lookup?search=0x8F3E3C06D428D10A