How can i connet the postgersql with ruby

Dear friends,
       Actually,I am having the lot of table in postgres.
But i need to access the table using the ruby.How could i access that
file.
how can i connet the postgersql with ruby.Plese any one tell to me.

by
vellingiri

···

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

Vellingiri Arul wrote:

Dear friends,
       Actually,I am having the lot of table in postgres.
But i need to access the table using the ruby.How could i access that
file.
how can i connet the postgersql with ruby.Plese any one tell to me.

by
vellingiri

Dear Friends,
As per my mail I myself took risk to findout the answers.
For example,
I am having the postgresql table,In that I am having lot of table.
I want to access the particular inforamtion.
How we could do?
solution is here:
require 'postgres'
conn=PGconn.connect("fountserver",5432,'','',"vellingiri","vellingiri","vellingiri")
res=conn.exec('select * from birthday')
res.each do |row|
row.each do |column|
print column
(20-column.length).times{print " "}
end
puts
end

Note:other than that If it is there anything please tell me .
by
vellingiri

···

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

Vellingiri,

If you are not using an ORM, this is the proper idea for directly
interfacing.

Best wishes,
  ~Wayne

···

On 10/17/07, Vellingiri Arul <hariharan.spc@rediffmail.com> wrote:

Note:other than that If it is there anything please tell me .
by
vellingiri