[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem with Ruby-Postgres querying database schema

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



1 Answer

Alexey Verkhovsky

10/23/2004 1:45:00 PM

0

I figured it out, and it has nothing to do with Ruby. See
http://dev.rubyonrails.org/trac.cgi/... for further details.

Alex