Re: proposal: psql: psql variable BACKEND_PID

From: Jelte Fennema <me(at)jeltef(dot)nl>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: proposal: psql: psql variable BACKEND_PID
Date: 2023-02-16 11:49:38
Message-ID: CAGECzQS4OGomdGeCrH07PH6y8wCmgFkBD=kObAHYFJXA-sV4ZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 16 Feb 2023 at 12:44, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2023-02-16 11:49:57 Re: Some revises in adding sorting path
Previous Message John Naylor 2023-02-16 11:46:50 Re: Considering additional sort specialisation functions for PG16