Alexey Verkhovsky
10/23/2004 12:05:00 PM
This query is supposed to tell me the default value of a particular
column:
activerecord_unittest=> SELECT column_name, column_default FROM
information_schema.columns WHERE table_name = 'defaults' AND column_name
= 'char1';
column_name | column_default
-------------+----------------
char1 | 'Y'::bpchar
(1 row)
As you can see above, in Postgres console it does exactly that.
However, when I run it in Ruby, it gives me nil:
irb> d = @connection.query("SELECT column_name, column_default FROM
information_schema.columns WHERE table_name = 'defaults' AND column_name
= 'char1'")
=> [["char1", nil]]
Best regards,
Alexey Verkhovsky