Re: [HACKERS] [ADMIN] How to determine date / time of last postmaster restart

2006-02-06 Thread Tom Lane
adey [EMAIL PROTECTED] 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


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

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


Re: [HACKERS] [ADMIN] How to determine date / time of last postmaster restart

2005-09-08 Thread Jim C. Nasby
On Wed, Sep 07, 2005 at 09:22:55PM -0400, Tom Lane wrote:
 Alvaro Herrera [EMAIL PROTECTED] writes:
  On Wed, Sep 07, 2005 at 12:38:44AM -0500, Jim C. Nasby wrote:
  Is it too late to add a function that returns last reset time as well?
  That would cover all bases and force some less confusing naming.
 
  This would be one more vote in favour of initdb before next beta.
  (pltemplate being the other one.)  We should set a threshold in order to
  be able to decide ...
 
 It looks like we'll be initdb'ing to add pltemplate, so if someone wants
 to submit a proposed patch for this ...

I might be able to do some of it; where would I need to capture reload
time?

Also, I'm thinking of leaving pg_postmaster_start_time as-is and adding
pg_postmaster_reload_time. Thoughts?

For reference, here's the original commit:
http://archives.postgresql.org/pgsql-committers/2005-06/msg00181.php
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

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

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


Re: [HACKERS] [ADMIN] How to determine date / time of last postmaster restart

2005-09-07 Thread Alvaro Herrera
On Wed, Sep 07, 2005 at 12:38:44AM -0500, Jim C. Nasby wrote:
 On Tue, Sep 06, 2005 at 08:22:34PM -0400, Tom Lane wrote:
  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.
 
 Is it too late to add a function that returns last reset time as well?
 That would cover all bases and force some less confusing naming.

This would be one more vote in favour of initdb before next beta.
(pltemplate being the other one.)  We should set a threshold in order to
be able to decide ...

-- 
Alvaro Herrera -- Valdivia, Chile Architect, www.EnterpriseDB.com
Use it up, wear it out, make it do, or do without

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] [ADMIN] How to determine date / time of last postmaster restart

2005-09-06 Thread Tom Lane
adey [EMAIL PROTECTED] 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


Re: [HACKERS] [ADMIN] How to determine date / time of last postmaster restart

2005-09-06 Thread Jim C. Nasby
On Tue, Sep 06, 2005 at 08:22:34PM -0400, Tom Lane wrote:
 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.

Is it too late to add a function that returns last reset time as well?
That would cover all bases and force some less confusing naming.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

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

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