The following bug has been logged on the website:
Bug reference: 15170
Logged by: Rick Gabriel
Email address: klaxian@gmail.com
PostgreSQL version: 10.3
Operating system: Ubuntu Linux 16.04
Description:
PQtransactionStatus() incorrectly returns PQTRANS_ACTIVE after committing an
empty transaction block (ie. BEGIN and COMMIT without any other queries).
From the documentation, I would expect PQTRANS_IDLE to be returned in this
case since the connection becomes idle, outside a transaction. If no other
queries are executed on the connection, it never returns to PQTRANS_IDLE
even after waiting for several seconds. I am testing with the PHP 7.1
PostgreSQL module, but I think this is a universal problem with PostgreSQL's
API.