Re: Comfortably check BackendPID with psql

From: Naoya Anzai <nao-anzai(at)xc(dot)jp(dot)nec(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, "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-06-12 06:00:51
Message-ID: 116262CF971C844FB6E793F8809B51C6E9AA7F@BPXM02GP.gisp.nec.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > >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.

Thank you all!
My hack is going to be much smoother.

Regards,

Naoya

---
Naoya Anzai
Engineering Department
NEC Solution Inovetors, Ltd.
E-Mail: nao-anzai(at)xc(dot)jp(dot)nec(dot)com
---

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-06-12 06:17:55 Re: pg_rewind failure by file deletion in source server
Previous Message Simon Riggs 2015-06-12 05:27:42 Re: Is it possible to have a "fast-write" Index?