Gaetano Mendola <[EMAIL PROTECTED]> writes:

> Well, the unix guys have the abit to have the uptime as an interval, I'm
> inclined to have boths:  pg_uptime ( interval ) and pg_starttime ( 
> timestamptz )

Well for the OS these are not redundant values. The clock could have been
adjusted at any time. So you can't just calculate uptime by subtracting the
current time from the start time.

I suppose this argument is true for Postgres as well. But I'm not sure
Postgres can really make the distinction as easily as the kernel. To return
the actual uptime without being deceived by clock changes it would need to
store not the wall clock time on startup, but the system uptime. And then
calculate the difference in the current system uptime. I'm not sure if there
is a portable interface to get a system uptime.

-- 
greg


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

Reply via email to