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

From Peter Eisentraut
Subject Re: proposal: psql: psql variable BACKEND_PID
Date
Msg-id 4e9f721a-21f4-8b4b-f854-13063f5a5762@enterprisedb.com
Whole thread Raw
In response to proposal: psql: psql variable BACKEND_PID  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal: psql: psql variable BACKEND_PID
List pgsql-hackers
On 03.02.23 11:41, Pavel Stehule wrote:
> We can simply allow an access to backend process id thru psql variable. 
> I propose the name "BACKEND_PID". The advantages of usage are simple 
> accessibility by command \set, and less typing then using function 
> pg_backend_pid, because psql variables are supported by tab complete 
> routine. Implementation is very simple, because we can use the function 
> PQbackendPID.

What would this be useful for?

You can mostly do this using

     select pg_backend_pid() AS "BACKEND_PID" \gset




pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Exit walsender before confirming remote flush in logical replication
Next
From: Hans Buschmann
Date:
Subject: AW: Wrong rows estimations with joins of CTEs slows queries by more than factor 500