Re: postgres uptime - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: postgres uptime
Date
Msg-id 20040820025056.GK6173@dcc.uchile.cl
Whole thread Raw
In response to Re: postgres uptime  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Responses Re: postgres uptime  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: postgres uptime  (Gavin Sherry <swm@linuxworld.com.au>)
Re: postgres uptime  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Aug 20, 2004 at 09:43:13AM +0800, Christopher Kings-Lynne wrote:
> >It seems that there is no way to know the postgres
> >uptime, a sort of uptime() function could be usefull.
> >I had recently the necessity of detect a node fail over,
> >and the only way I can do it with a SQL connection is asking
> >the engine uptime. Of course I can do it with PS but
> >now that windows version is out I believe a platform
> >indipendent way is required. Any objection to add it ?
> 
> That sounds like a cool idea to me, although I would suggest a function 
> pg_uptime() that returns an interval or something.
> 
> However, adding a new function requires a re-initdb, so it's quite 
> unlikely this will be in for 8.0.

Is the uptime kept internally anywhere?  Or even the start time?

If it is, it would be quite trivial to provide access to it, and there
is at least one other thing to do "if we initdb" in the open items list
for 8.0.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"El miedo atento y previsor es la madre de la seguridad" (E. Burke)



pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: tablespace and sequences?
Next
From: Tom Lane
Date:
Subject: Re: All three packages ...