Re: Comfortably check BackendPID with psql
От
Noah Misch
Тема
Re: Comfortably check BackendPID with psql
Дата
Msg-id
20150612045616.GA262677@tornado.leadboat.com
Ответ на
Re: Comfortably check BackendPID with psql (Jim Nasby)
Список
Дерево обсуждения
Comfortably check BackendPID with psql Naoya Anzai <nao-anzai@xc.jp.nec.com>
Re: Comfortably check BackendPID with psql Andres Freund <andres@anarazel.de>
Re: Comfortably check BackendPID with psql Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: Comfortably check BackendPID with psql Noah Misch <noah@leadboat.com>
Re: Comfortably check BackendPID with psql Naoya Anzai <nao-anzai@xc.jp.nec.com>
Re: Comfortably check BackendPID with psql Julien Rouhaud <julien.rouhaud@dalibo.com>
Re: Comfortably check BackendPID with psql Andres Freund <andres@anarazel.de>
Re: Comfortably check BackendPID with psql Tom Lane <tgl@sss.pgh.pa.us>
Re: Comfortably check BackendPID with psql Andres Freund <andres@anarazel.de>
Re: Comfortably check BackendPID with psql Julien Rouhaud <julien.rouhaud@dalibo.com>
Re: Comfortably check BackendPID with psql Petr Korobeinikov <pkorobeinikov@gmail.com>
Re: Comfortably check BackendPID with psql Marko Tiikkaja <marko@joh.to>
Re: Comfortably check BackendPID with psql Naoya Anzai <nao-anzai@xc.jp.nec.com>
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 +0000, 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 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 using gdb. You can get that today. In ~/.psqlrc: SELECT pg_catalog.pg_backend_pid() AS backend_pid \gset \set PROMPT1 '%m %:backend_pid: %/%R%# ' It doesn't update after \connect, but the overlap between my use of \connect and my use of debuggers is tiny.
В списке pgsql-hackers по дате отправления