From: Michael Neumann Date: 2005-01-08T09:12:15+09:00 Subject: Re: postgres-pr Ernest Ellingson wrote: > Michael Neumann wrote: > >> Ernest Ellingson wrote: >> >>> Thanks Michael >>> I'm still not sure about Pg.rb. Where is it? It's not in the DBI or >>> the DBD directory. Does it exist? How do I get it? >> >> >> >> Ah, okay. I think it's not bundled with the Windows-Installer, as you >> need the postgres.so or postgres-pr libraries. And postgres.so is/was >> not available for Windows AFAIK. >> >> You can download it from here: >> >> http://ntecs.de/viewcvs/viewcvs/dbd-pg/trunk/src/?root=ruby-dbi >> >> Just put the Pg.rb into the DBD/Pg directory (create the Pg directory). >> >>> As for postgres-pr I tried the test_connection.rb code changed the >>> uri to 'tcp://ipaddress:5432' and the other parameters to appropriate >>> values. Apparently a connection is being made but the same blow up >>> in page files occurs 1.25 GB's. The program finally errors out with >>> this trace. I should mention the database is on another machine >>> running RH linux 9 and postgresql 7.4. >> >> >> >> Hm, very strange. Does using TCPSockets generally work on your >> platform without problems? >> >>> c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.3.3/lib/buffer.rb:64:in >>> `read': failed to allocate memory (NoMemoryError) >> >> >> >> I should include some debug code. It might be, that there's a negative >> buffer-length which gets interpreted as an unsigned value... or >> something like this. You're on a 32-bit machine, right? >> >> Regards, >> >> Michael >> >> > I haven't had a problem with smtp or gets or posts with httpAccess2 so I > believe that TCPsockets are working fine. I am running a 32 bit machine > WindowsXP svc Pack 2. Could you patch message.rb of postgres-pr with the following patch, and tell me what you get on STDOUT: Index: message.rb =================================================================== --- message.rb (revision 475) +++ message.rb (working copy) @@ -32,6 +32,8 @@ type = stream.readbytes(1).unpack('C').first unless startup length = stream.readbytes(4).unpack('N').first # FIXME: length should be signed, not unsigned + p length + raise ParseError unless length >= 4 # initialize buffer Regards, Michael