[DB-SIG] pyPgSQL updates

Eric Soroos eric-python at soroos.net
Tue Sep 13 20:19:35 CEST 2011


It appears that pyPgSQL has been abandoned and Postgresql is starting to 
pass it by. I've sent a
note to the pyPgSQL dev list and gotten no response. So I'm doing a bit 
of maintenance now.

I've worked up some changes to the quoting to allow it to use the new to 
9.0 hex encoding
for bytea fields. At the same time, I've changed the string and bytea 
quoting to use
PQescapeStringConn and PQescapeByteaConn so that they properly quote the 
incoming items
based on the connection settings.

Code is at: https://github.com/wiredfool/PyPgSQL

I'm also looking at including support for PQexecParams to reduce the 
memory footprint when
adding large bytea items to the database. In my tests, the released 
version uses ~40x the binary
size, my updated version uses 10-20x, and PQexecParams uses ~ 2.7x 
(though, the test harness
starts to be a factor there).  This method appears to be well outside 
the DB2.0 spec, so it would be
driver specific.



More information about the DB-SIG mailing list