PG Bug reporting form <noreply@postgresql.org> writes:
> 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.
The existing documentation defines it as "a command is in progress",
which seems perfectly clear to me --- adding more words would just
muddy the waters.
Also, if a command is running then the server *does* have a transaction
open -- it might be an auto-started, auto-committed one, but there's
always a transaction. You seem to be using that word in a way that does
not correspond with common Postgres usage. (Note that the definitions for
PQTRANS_INTRANS and PQTRANS_INERROR say "transaction block" not
"transaction", to comport with our usual terminology.)
regards, tom lane