Re: BUG #17824: PQTRANS_ACTIVE misleading

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: akschoenberger(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17824: PQTRANS_ACTIVE misleading
Date: 2023-03-08 16:22:07
Message-ID: CAKFQuwb0bADD37jeNGLhGQugA2ok0d4q-_zKc8ja0QGupiGv8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Mar 8, 2023 at 8:28 AM PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference: 17824
> Logged by: Andy Schoenberger
> Email address: akschoenberger(at)gmail(dot)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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-03-08 16:22:19 Re: BUG #17824: PQTRANS_ACTIVE misleading
Previous Message Tom Lane 2023-03-08 15:50:23 Re: pg_basebackup fails with Could not stat file or directory "./.pg_hba.conf.un~"