Re: How to determine date / time of last postmaster restart - Mailing list pgsql-admin

From Tom Lane
Subject Re: How to determine date / time of last postmaster restart
Date
Msg-id 22041.1126052554@sss.pgh.pa.us
Whole thread Raw
In response to How to determine date / time of last postmaster restart  (adey <adey11@gmail.com>)
List pgsql-admin
adey <adey11@gmail.com> writes:
> Please let me know if there is a way to determine when the Postmaster was
> last restarted?

The last postmaster start time, or the last database reset?  These are
not the same if any backends have crashed since the postmaster started.
For determining stats lifespan I think you need the latter.

Offhand I think the file timestamp of $PGDATA/postmaster.opts would do
for the postmaster start time, and postmaster.pid for the other (I think
postmaster.pid is updated during a reset).

PG 8.1 will have a function to return postmaster start time, but not
database reset time.  I wonder if this is misdefined --- if you are
trying to measure database uptime, the last reset would be more
appropriate to track.

            regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq


pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Disabling WAL for bulk data loads
Next
From: Jaime Casanova
Date:
Subject: Re: Alter Table vs. Rename/Create/Drop table with plpgsql functions.