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