Re: [HACKERS] Comfortably check BackendPID with psql

2015-07-07 Thread Andres Freund
On 2015-07-07 10:17:39 -0400, Tom Lane wrote: > I would s/pid/process ID/ in the docs. "PID" is not a particularly > user-friendly term, and it's even less so if you fail to upper-case it. We have both pid and PID in a bunch of places in the docs, and pid in the ones that seem more likely to be n

Re: [HACKERS] Comfortably check BackendPID with psql

2015-07-07 Thread Tom Lane
Andres Freund writes: > 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. I would s/pid/process ID/ in the docs. "PID" is not a particularly user-frie

Re: [HACKERS] Comfortably check BackendPID with psql

2015-07-07 Thread Julien Rouhaud
Le 07/07/2015 13:41, Andres Freund a écrit : > 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 >

Re: [HACKERS] Comfortably check BackendPID with psql

2015-07-07 Thread Andres Freund
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. Pus

Re: [HACKERS] Comfortably check BackendPID with psql

2015-07-05 Thread Petr Korobeinikov
+1 for Julien's patch.

Re: [HACKERS] Comfortably check BackendPID with psql

2015-07-05 Thread Julien Rouhaud
On 12/06/2015 06:56, Noah Misch wrote: > On Thu, Jun 11, 2015 at 04:05:13PM -0500, Jim Nasby wrote: >> On 6/11/15 4:55 AM, Andres Freund wrote: >>> On 2015-06-11 09:41:17 +, Naoya Anzai wrote: This is a so tiny patch but I think it is very useful for hackers and DBAs. When we debug wi

Re: [HACKERS] Comfortably check BackendPID with psql

2015-06-11 Thread Naoya Anzai
> > >Not a big fan of that abbreviation itself. What I'd wondered about > > >instead - and actually had patched into my psql at some point - is > > >adding an appropriate escape to psql's PROMPT. I think that'd serve your > > >purpose as well? > > > > +3.14159; that would be hugely helpful when us

Re: [HACKERS] Comfortably check BackendPID with psql

2015-06-11 Thread Noah Misch
On Thu, Jun 11, 2015 at 04:05:13PM -0500, Jim Nasby wrote: > On 6/11/15 4:55 AM, Andres Freund wrote: > >On 2015-06-11 09:41:17 +, Naoya Anzai wrote: > >>This is a so tiny patch but I think it is very useful for hackers and DBAs. > >>When we debug with psql, we frequently use "SELECT pg_backend

Re: [HACKERS] Comfortably check BackendPID with psql

2015-06-11 Thread Jim Nasby
On 6/11/15 4:55 AM, Andres Freund wrote: Hi, On 2015-06-11 09:41:17 +, Naoya Anzai wrote: This is a so tiny patch but I think it is very useful for hackers and DBAs. When we debug with psql, we frequently use "SELECT pg_backend_pid();". This can change the input of the 24 characters to the

Re: [HACKERS] Comfortably check BackendPID with psql

2015-06-11 Thread Naoya Anzai
Hi, Andres, Marko > Seems easier to set this in .psqlrc: oops! I've never noticed.. Thank you for your comment. Regards, Naoya --- Naoya Anzai Engineering Department NEC Solution Inovetors, Ltd. E-Mail: nao-an...@xc.jp.nec.com --- -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgre

Re: [HACKERS] Comfortably check BackendPID with psql

2015-06-11 Thread Andres Freund
Hi, On 2015-06-11 09:41:17 +, Naoya Anzai wrote: > This is a so tiny patch but I think it is very useful for hackers and DBAs. > When we debug with psql, we frequently use "SELECT pg_backend_pid();". > This can change the input of the 24 characters to the only 4 characters! Not a big fan of t

Re: [HACKERS] Comfortably check BackendPID with psql

2015-06-11 Thread Marko Tiikkaja
On 6/11/15 11:41 AM, Naoya Anzai wrote: > This can change the input of the 24 characters to the only 4 characters! > > Image. > -- > naoya=# \bid > Backend Process ID > pid > -- > 1716 > (1 row) > --- > > How do you like it? Seems easier to set thi

[HACKERS] Comfortably check BackendPID with psql

2015-06-11 Thread Naoya Anzai
Hi, hackers! This is a so tiny patch but I think it is very useful for hackers and DBAs. When we debug with psql, we frequently use "SELECT pg_backend_pid();". This can change the input of the 24 characters to the only 4 characters! Image. -- naoya=# \bid Backend Process ID p