Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Problem with Ruby-Postgres querying database schema

Reply
Thread Tools

Problem with Ruby-Postgres querying database schema

 
 
Alexey Verkhovsky
Guest
Posts: n/a
 
      10-23-2004
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



 
Reply With Quote
 
 
 
 
Alexey Verkhovsky
Guest
Posts: n/a
 
      10-23-2004
I figured it out, and it has nothing to do with Ruby. See
http://dev.rubyonrails.org/trac.cgi/ticket/118 for further details.

Alex



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Querying Schema/RNG files Mikolaj Machowski XML 3 02-16-2006 08:39 AM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
Troubles Querying Database in Application_Start Ober ASP .Net 6 09-13-2004 10:41 PM



Advertisments