Re: proposal: psql: psql variable BACKEND_PID

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: psql: psql variable BACKEND_PID
Дата
Msg-id CAFj8pRDuKBApsSJrF6fNHBHd-b8+78b=Y5Ay4WjxRm2fiw9RdA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: psql: psql variable BACKEND_PID  (Corey Huinker <corey.huinker@gmail.com>)
Ответы Re: proposal: psql: psql variable BACKEND_PID  (Corey Huinker <corey.huinker@gmail.com>)
Список pgsql-hackers
Hi


pá 3. 2. 2023 v 20:27 odesílatel Corey Huinker <corey.huinker@gmail.com> napsal:


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.

with doc and unsetting variable

Regards

Pavel
 



 
Вложения

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

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: Weird failure with latches in curculio on v15
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: recovery modules