Re: proposal: psql: psql variable BACKEND_PID

Поиск
Список
Период
Сортировка
От Corey Huinker
Тема Re: proposal: psql: psql variable BACKEND_PID
Дата
Msg-id CADkLM=fQUAGG2WXO3_2Qci+-nR3URmzi0E03Wvizwg71MORwvg@mail.gmail.com
обсуждение исходный текст
Ответ на proposal: psql: psql variable BACKEND_PID  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: proposal: psql: psql variable BACKEND_PID  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers


On Fri, Feb 3, 2023 at 5:42 AM Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hi

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.

Comments, notes?

Regards

Pavel

Interesting, and probably useful.

It needs a corresponding line in UnsyncVariables():

SetVariable(pset.vars, "BACKEND_PID", NULL);

That will set the variable back to null when the connection goes away.



 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: Weird failure with latches in curculio on v15
Следующее
От: Tom Lane
Дата:
Сообщение: First draft of back-branch release notes is done