Re: proposal: psql: psql variable BACKEND_PID - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: psql: psql variable BACKEND_PID
Date
Msg-id CAFj8pRCOf6afVQMUL5=CwehPvaCCiLPNtYNTwiYL10+FLh56RA@mail.gmail.com
Whole thread Raw
In response to Re: proposal: psql: psql variable BACKEND_PID  (Jelte Fennema <me@jeltef.nl>)
Responses Re: proposal: psql: psql variable BACKEND_PID
List pgsql-hackers


čt 16. 2. 2023 v 12:49 odesílatel Jelte Fennema <me@jeltef.nl> napsal:
On Thu, 16 Feb 2023 at 12:44, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> To find and use pg_backend_pid is not rocket science. But use :BACKEND_PID is simpler.

I wanted to call out that if there's a connection pooler (e.g.
PgBouncer) in the middle, then BACKEND_PID (and %p) are incorrect, but
pg_backend_pid() would work for the query. This might be an edge case,
but if BACKEND_PID is added it might be worth listing this edge case
in the docs somewhere.

good note

Regards

Pavel

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Should CreateExprContext() be using ALLOCSET_DEFAULT_SIZES?
Next
From: Zheng Li
Date:
Subject: Re: Support logical replication of DDLs