Re: BUG #17824: PQTRANS_ACTIVE misleading
От | David G. Johnston |
---|---|
Тема | Re: BUG #17824: PQTRANS_ACTIVE misleading |
Дата | |
Msg-id | CAKFQuwb0bADD37jeNGLhGQugA2ok0d4q-_zKc8ja0QGupiGv8w@mail.gmail.com обсуждение исходный текст |
Ответ на | BUG #17824: PQTRANS_ACTIVE misleading (PG Bug reporting form <noreply@postgresql.org>) |
Список | pgsql-bugs |
On Wed, Mar 8, 2023 at 8:28 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:
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.
…but a `*` character is also technically used if the transaction status is
PQTRANS_ACTIVE, which does not necessarily happen during a transaction.
https://github.com/postgres/postgres/blob/46d490ac19a7ca93a5c0f47e5a0e759b5385a8ae/src/bin/psql/prompt.c#L236
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.
David J.
В списке pgsql-bugs по дате отправления: