Re: Comfortably check BackendPID with psql

From: Andres Freund <andres(at)anarazel(dot)de>
To: Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>, Naoya Anzai <nao-anzai(at)xc(dot)jp(dot)nec(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Akio Iwaasa <aki-iwaasa(at)vt(dot)jp(dot)nec(dot)com>
Subject: Re: Comfortably check BackendPID with psql
Date: 2015-07-07 11:41:00
Message-ID: 20150707114100.GK30359@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-07-05 14:11:38 +0200, Julien Rouhaud wrote:
> Tiny for me too, but I sometimes had the need.
>
> I can't really see any good reason not to add a %p escape to psql's
> PROMPT, so I'm attaching a simple patch to implement it. Unless someone
> objects, I'll add it to the next commitfest.

Pushed the patch. I only made a minor belt-and-suspenders type of
change, namely to check whether PQbackendPID() returns 0 and not print
that and replaced PID by pid in the docs and comments.

Thanks for the patch!

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-07-07 11:49:15 Re: Freeze avoidance of very large table.
Previous Message Heikki Linnakangas 2015-07-07 11:31:34 Re: 9.6 First Commitfest Begins