Re: uptime() for postmaster

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: uptime() for postmaster
Дата
Msg-id 87llb97kte.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: uptime() for postmaster  (Gaetano Mendola <mendola@bigfoot.com>)
Список pgsql-hackers
Gaetano Mendola <mendola@bigfoot.com> 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [PATCHES] Bgwriter behavior
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: [PATCHES] Bgwriter behavior