- changed milestone to 0.6.xx
- assigned issue to
[Jython] [pg8000] Prepare two phase transaction fails
Issue #1386
resolved
On postgres+zxjdbc, do_prepare_twophase fails on:
connection.execute(sql.text("PREPARE TRANSACTION :tid", bindparams=[xid)](sql.bindparam('tid',)))
The zxJDBC driver uses the qmark format type, so the bind parameterization ends up translating this query to:
PREPARE TRANSACTION ?
But postgres only seems to support a constant string here. pg8000 users also noticed this issue:
https://bugs.launchpad.net/pg8000/+bug/230794
Is replacing this with connection.execute("PREPARE TRANSACTION '%s'" % xid) safe enough, or do we need something else?
Comments (6)
-
repo owner -
repo owner - assigned issue to
-
repo owner if PG in general requires a constant string, and psycopg2 was just letting us get away with it, then yes we should change that to just be an inline string (and we can lose the
text()
construct too while we're at it). -
- assigned issue to
-
- changed status to resolved
zzzeek fixed this
-
repo owner - removed milestone
Removing milestone: 0.6.xx (automated comment)
- Log in to comment