PREPARE TRANSACTION $1 causes a parse error

Bug #230794 reported by Mathieu Fenniak
2
Affects Status Importance Assigned to Milestone
pg8000
Won't Fix
Low
Mathieu Fenniak

Bug Description

In SQLAlchemy's engine.transaction.TLTransactionTest.testtwophasetransaction, the following appears to be being executed:

  cursor.execute("PREPARE TRANSACTION %(tid)s", {"tid": "..."})

which results in a PostgreSQL database error:

  ERROR 42601 'syntax error at or near "$1"'

Suggesting that a bind parameter cannot be used in PREPARE TRANSACTION.

Changed in pg8000:
assignee: nobody → mfenniak
importance: Undecided → Low
milestone: none → sqlalchemy
status: New → Confirmed
Revision history for this message
Mathieu Fenniak (mfenniak) wrote :

PostgreSQL only supports a constant string in PREPARE TRANSACTION (as well as number of other places), and not a bind parameter. Therefore this will be documented as a known issue, and must be handled client-side (or part of a library like SQLAlchemy).

Changed in pg8000:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.