pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: adey11@gmail.com
Cc: pgsql-admin@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: How to determine date / time of last postmaster restart
Date: Tue, 06 Sep 2005 20:22:34 -0400
Message-ID: <22041.1126052554@sss.pgh.pa.us> (raw)
In-Reply-To: <1c66bda805090616596a199871@mail.gmail.com>
References: <1c66bda805090616596a199871@mail.gmail.com>

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



view thread (8+ messages)  latest in thread

Message-ID: <22041.1126052554@sss.pgh.pa.us>
Permalink:  ../22041.1126052554@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22041.1126052554@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, adey11@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: How to determine date / time of last postmaster restart
  In-Reply-To: <22041.1126052554@sss.pgh.pa.us>
  References: <1c66bda805090616596a199871@mail.gmail.com> <22041.1126052554@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox