[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Strange problem with rb-postgres

ngw

3/2/2006 5:38:00 PM

Hi *,
I'm using rb-postgres:

require 'postgres'

begin
dbh = PGconn.new("127.0.0.1", 5432, "", "", "test", "usertest",
"passwdtest")
puts dbh.server_version
dbh.close
rescue PGError => e
puts e.message
end

This code actually doesn't work, the method server_version is undefined, but
is documented here: http://ruby.scripting.ca/post...
What's happening here ? Is the documentation outdated ?

ngw
1 Answer

Mark Probert

3/3/2006 7:32:00 PM

0

ngw wrote:
> Hi *,
> I'm using rb-postgres:
>
> require 'postgres'
>
I think this is the C extension, right? I have the version last updated

$Author: noboru $
$Date: 2003/01/06 01:38:20 $

> This code actually doesn't work, the method server_version
> is undefined,

Yup.

> begin
> dbh = PGconn.new("127.0.0.1", 5432, "", "", "test", "usertest",
> "passwdtest")
> puts dbh.server_version

Instead, you can:

puts conn.exec("show server_version").result

Hope this helps

--

-mark.

----------------------------------------------------
Mark Probert probertm at acm dot org
----------------------------------------------------