Hi PostgreSQL Hackers

I started to look around for a solution of current pgJDBC shortcoming
of having to emulate WITH HOLD cursors and found this discussion
(https://github.com/pgjdbc/pgjdbc/discussions/3323) mentioning
connection pooling.

I did not find anything in the wire protocol documentation about
indicating the presence of cursos held over transactions, but this
info seems essential to properly handling them in case of transaction
pooling.

Would it make sense to add one more byte ('H' ?) at the end of the
ReadyForQuery backend message to indicate that there are cursors that
live across transactions, so thet the connection pooler knows to not
give the database connections to other clients while this is happening
?

Or should we keep the current structure of just one byte and add
another value to indicate "idle but with a cursor on hold" as the
cursor only matters if outside a transaction.

So the full set of values for Current backend transaction status
indicator becomes:
 -  'I' if idle (not in a transaction block);
 -  'T' if in a transaction block;
 -  'E' if in a failed transaction block (queries will be rejected
until block is ended)
 + 'H' if idle but with a held cursor.

The second option, maybe together with a flag activating/disabling the
'H' option seems to be the least disruptive

Thoughts?

---
Hannu


Reply via email to