Re: Availability of pg_backend_pid() immediately after connection establishment - Mailing list pgsql-general

From Magnus Hagander
Subject Re: Availability of pg_backend_pid() immediately after connection establishment
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCEA35893@algol.sollentuna.se
Whole thread Raw
In response to Availability of pg_backend_pid() immediately after connection establishment  (Hari Bhaskaran <hbhaskaran@gmail.com>)
Responses Re: Availability of pg_backend_pid() immediately after connection establishment  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> Someone in this group mentioned a while back that
> pg_backend_pid() function works only after some 1/2 second
> after the connection has been established.  This had
> something to do with the stats collector to make its sweep
> every .5 seconds?.  Does anyone have more information on this?

No, pg_backend_pid() returns MyProcPid, which is set on backend startup.

However, the different pg_stat_* views won't work until a message has
been passed down to the stats collector, that is correct.

//Magnus

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: time value '24:00:00'
Next
From: tomas@tuxteam.de
Date:
Subject: Re: [HACKERS] Index greater than 8k