From: | "Eric Crampton" <escpg(at)eonomine(dot)com> |
---|---|
To: | pgsql-patches(at)postgresql(dot)org |
Subject: | Patch for Postmaster Uptime (from the TODO) |
Date: | 2005-02-24 22:49:00 |
Message-ID: | 39796.207.171.180.101.1109285340.spork@webmail.eonomine.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-patches |
Hello hackers,
I noticed in the TODO that there is an item requesting a function which
returns the uptime of the postmaster. I've wanted that as well. So, I've
added just such a thing: server_start_time(). This function returns the
time when the postmaster was started; a simple now() - server_start_time()
returns the uptime.
The below patches are for four files:
* postmaster.c: Now calls a new function, MarkServerStartTime(), before
calling ServerLoop().
* timestamp.h/timestamp.c: New functions: MarkServerStartTime() (called
from postmaster.c) and server_start_time(), a new SQL function which may
be called.
* pg_proc.h: Added DATA and DESCR to the very end of the list (OID=2557)
for the server_start_time function.
I didn't bother to include the generated fmgroids.h and fmgrtab.c. Since
they are small, I've attached the four unified diffs against the 8.0.1
code. Let me know if there's anything different the code should have done.
--Eric
Attachment | Content-Type | Size |
---|---|---|
pg_proc.h.diff | application/octet-stream | 609 bytes |
postmaster.c.diff | application/octet-stream | 337 bytes |
timestamp.c.diff | application/octet-stream | 1.2 KB |
timestamp.h.diff | application/octet-stream | 410 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Neil Conway | 2005-02-24 23:03:28 | Re: psql: recall previous command? |
Previous Message | Tom Lane | 2005-02-24 22:47:44 | Re: [NOVICE] Question on TRUNCATE privleges |
From | Date | Subject | |
---|---|---|---|
Next Message | Ron Mayer | 2005-02-24 23:08:34 | Re: [PATCHES] A way to let Vacuum warn if FSM settings are low. |
Previous Message | Ron Mayer | 2005-02-24 22:43:45 | Re: [PATCHES] A way to let Vacuum warn if FSM settings are low. |