From: Yohanes Santoso Date: 2005-01-30T12:54:06+09:00 Subject: Re: postgres module Jeff Davis writes: > The primary module for accessing a PostgreSQL database seems to be the > 'postgres' module on RAA. Hi Jeff, Actually, I think the more common one is with ruby-dbi (which eventually uses that postgres module). The DBI provides a more ruby-like interface: > pg.exec("select * from my_table") do |rec| # don't you need a rec.each here? > puts "#{rec['name']} #{rec['occupation']}" > end dbh.execute("select * from my_table") {|sth| sth.each{|row| puts "#{row['name']} #{row['occupation']}}} More on: http://www.kitebird.com/articles/ruby-dbi.html > However, the last release was in '03, and it seems like the module > could use a little improvement. Also, it never hit that 1.0 mark, so I > suppose the author doesn't think it's quite done either. The module binds to libpq from postgresql. I scanned the change log of libpq from 2003, and although there are changes, none seems major. > I am interested in writing a new postgresql module, is that a good > idea? In any case, wouldn't it be easier for you and better for the ruby community if you extend the existing postgres module? > Also, there just seem to be some things missing from the 'postgres' > module, like getnotify(), asynchronous queries, etc. Hm.. I don't know. To me, it sounds like something that can be incrementally added to the existing module and is not major enough as to warrant a complete rewrite. But that's just me. YS.