postgres wont do preparedstatements

Paul J Stevens paul at nfg.nl
Sat Feb 23 09:49:47 CET 2008


Jan-Henrik,

So I converted dbmail to use libzdb, and use prepared statements.

But I can't seem to get prepared statements to work for postgresql.

Sqlite and mysql work as expected by postgres keeps throwing exceptions.

My test code reads:

//URL_T url = \
URL_new("postgresql://localhost:5432/dbmail?user=dbmail&password=dbmail");
URL_T url = URL_new("postgresql://dbmail:dbmail@localhost/dbmail");
ConnectionPool_T pool = ConnectionPool_new(url);
Connection_T con = ConnectionPool_getConnection(pool);
PreparedStatement_T p = Connection_prepareStatement(con, "SELECT * FROM
dbmail_users WHERE userid=?");

THis keeps throwing exception at:


Uncaught exception SQLException raised in Connection_prepareStatement at
src/db/Connection.c:294

On the postgres side all I see is:


2008-02-23 09:46:48 CET DEBUG:  parse 1804289383: SELECT * FROM
dbmail_users WHERE userid=$1
2008-02-23 09:46:48 CET DEBUG:  StartTransactionCommand
2008-02-23 09:46:48 CET DEBUG:  StartTransaction
2008-02-23 09:46:48 CET DEBUG:  name: unnamed; blockState:
DEFAULT; state: INPROGR, xid/subid/cid: 2270118/1/0, nestlvl: 1,
children: <>
2008-02-23 09:46:48 CET DEBUG:  CommitTransactionCommand
2008-02-23 09:46:48 CET DEBUG:  CommitTransaction
2008-02-23 09:46:48 CET DEBUG:  name: unnamed; blockState:
STARTED; state: INPROGR, xid/subid/cid: 2270118/1/1, nestlvl: 1,
children: <>
2008-02-23 09:46:48 CET LOG:  unexpected EOF on client connection


Any ideas?





-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl


More information about the libzdb-general mailing list