Re: proposal: psql: psql variable BACKEND_PID

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: proposal: psql: psql variable BACKEND_PID
Date: 2023-02-09 08:57:07
Message-ID: 4e9f721a-21f4-8b4b-f854-13063f5a5762@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hans Buschmann 2023-02-09 09:03:32 AW: Wrong rows estimations with joins of CTEs slows queries by more than factor 500
Previous Message Masahiko Sawada 2023-02-09 08:33:57 Re: Exit walsender before confirming remote flush in logical replication