Bug reference: 17824 Logged by: Andy Schoenberger Email address: akschoenberger@gmail.com PostgreSQL version: 15.2 Operating system: All Description:
The documentation for PQTRANS_ACTIVE [1] does not make explicitly clear that it is returned in *all* cases where there is a command in progress on an okay connection, and not just in the case that there is a command in progress inside of a transaction [2]. With a name like PQTRANS_ACTIVE, I believe it is worth making clear that it can happen when a transaction is not active.
It is not possible for the server to execute a command without there being an active transaction in progress.
I’m not sure if this is actually considered a bug or not since I don’t think psql displays a new prompt until after the command completes, but the logic in the code being misleading does not help.
Right, it is difficult to report on/see the implicit transaction that occurs if you send a command to the server without constructing an explicit transaction block, since it goes away as the command execution ends.