Re: Comfortably check BackendPID with psql

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Naoya Anzai <nao-anzai(at)xc(dot)jp(dot)nec(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Cc: Akio Iwaasa <aki-iwaasa(at)vt(dot)jp(dot)nec(dot)com>
Subject: Re: Comfortably check BackendPID with psql
Date: 2015-06-11 09:48:15
Message-ID: 5579595F.8010901@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 this in .psqlrc:

\set bid 'select pg_backend_pid();'

and then:

=# :bid
pg_backend_pid
----------------
84430
(1 row)

No patches or concerns for psql version necessary.

.m

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2015-06-11 09:52:12 Re: skipping pg_log in basebackup (was Re: pg_basebackup and pg_stat_tmp directory)
Previous Message Naoya Anzai 2015-06-11 09:41:17 Comfortably check BackendPID with psql