Re: [HACKERS] postgres uptime

2004-08-21 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Lane wrote: | Gaetano Mendola [EMAIL PROTECTED] writes: | |I think we should just call gettimeofday() at postmaster start and store |it somewhere. | | |Isn't the shared memory a good place ? | | | Depends. Do you want to reset it during a

Re: [HACKERS] postgres uptime

2004-08-20 Thread Richard Huxton
Tom Lane wrote: Marc G. Fournier [EMAIL PROTECTED] writes: Does anyone have any 'benefits' to implementing such a thing that we can list? The cons appear to be easy, what about pros? That's exactly what's bugging me --- I have not seen any particularly strong defense of why we *should* have

Re: [HACKERS] postgres uptime

2004-08-20 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 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

Re: [HACKERS] postgres uptime

2004-08-20 Thread Gaetano Mendola
Tom Lane wrote: I'd like to see more than one person requesting this (and with solider rationales) before it gets added to TODO. If I wanted to be picky I would suggest that knowledge of the server start time might be useful information to an attacker. It would for instance narrow down the

Re: [HACKERS] postgres uptime

2004-08-20 Thread Gaetano Mendola
Richard Huxton wrote: Tom Lane wrote: Marc G. Fournier [EMAIL PROTECTED] writes: Does anyone have any 'benefits' to implementing such a thing that we can list? The cons appear to be easy, what about pros? That's exactly what's bugging me --- I have not seen any particularly strong defense of

Re: [HACKERS] postgres uptime

2004-08-20 Thread Robert Treat
On Fri, 2004-08-20 at 05:41, Gaetano Mendola wrote: Tom Lane wrote: I'd like to see more than one person requesting this (and with solider rationales) before it gets added to TODO. If I wanted to be picky I would suggest that knowledge of the server start time might be useful

Re: [HACKERS] postgres uptime

2004-08-20 Thread Andreas Pflug
Robert Treat wrote: If we do add this function, I guarantee you that you'll see it added to phppgadmin and pgadmin, because it helps make these remote administration tools more complete. :-) Guess what I just implemented... pg_postmaster_starttime() RETURNS timestamp, currently implemented in

Re: [HACKERS] postgres uptime

2004-08-20 Thread Bruce Momjian
Andreas Pflug wrote: Robert Treat wrote: If we do add this function, I guarantee you that you'll see it added to phppgadmin and pgadmin, because it helps make these remote administration tools more complete. :-) Guess what I just implemented... pg_postmaster_starttime() RETURNS

Re: [HACKERS] postgres uptime

2004-08-20 Thread Andreas Pflug
Bruce Momjian wrote: I think we should just call gettimeofday() at postmaster start and store it somewhere. No objections, but that's probably not done in 8.0 any more, right? Regards, Andreas ---(end of broadcast)--- TIP 2: you can get off all

Re: [HACKERS] postgres uptime

2004-08-20 Thread Bruce Momjian
Andreas Pflug wrote: Bruce Momjian wrote: I think we should just call gettimeofday() at postmaster start and store it somewhere. No objections, but that's probably not done in 8.0 any more, right? Right. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL

Re: [HACKERS] postgres uptime

2004-08-20 Thread Gaetano Mendola
Bruce Momjian wrote: Andreas Pflug wrote: Guess what I just implemented... pg_postmaster_starttime() RETURNS timestamp, currently implemented in the admin module for win32 using GetProcessTimes(PostmasterHandle). What's the equivalent for posix? Interpreting popen(ps...) might get messy. I

Re: [HACKERS] postgres uptime

2004-08-20 Thread Tom Lane
Gaetano Mendola [EMAIL PROTECTED] writes: I think we should just call gettimeofday() at postmaster start and store it somewhere. Isn't the shared memory a good place ? Depends. Do you want to reset it during a backend-crash-recovery cycle? You'll have to, if it's only stored in shared

[HACKERS] postgres uptime

2004-08-19 Thread Gaetano Mendola
Hi all, 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

Re: [HACKERS] postgres uptime

2004-08-19 Thread Christopher Kings-Lynne
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

Re: [HACKERS] postgres uptime

2004-08-19 Thread Alvaro Herrera
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

Re: [HACKERS] postgres uptime

2004-08-19 Thread Bruce Momjian
Added to TODO: * Add a function that returns the 'uptime' of the postmaster --- Alvaro Herrera wrote: On Fri, Aug 20, 2004 at 09:43:13AM +0800, Christopher Kings-Lynne wrote: It seems that there is no way to

Re: [HACKERS] postgres uptime

2004-08-19 Thread Gavin Sherry
On Thu, 19 Aug 2004, Alvaro Herrera wrote: 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

Re: [HACKERS] postgres uptime

2004-08-19 Thread Marc G. Fournier
On Fri, 20 Aug 2004, Gavin Sherry wrote: On Thu, 19 Aug 2004, Alvaro Herrera wrote: 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

Re: [HACKERS] postgres uptime

2004-08-19 Thread Larry Rosenman
Marc G. Fournier wrote: On Fri, 20 Aug 2004, Gavin Sherry wrote: On Thu, 19 Aug 2004, Alvaro Herrera wrote: 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.

Re: [HACKERS] postgres uptime

2004-08-19 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Is the uptime kept internally anywhere? Or even the start time? No, and no (at least not in any globally accessible variable). If it is, it would be quite trivial to provide access to it Not really --- in the EXEC_BACKEND case, we'd have to do

Re: [HACKERS] postgres uptime

2004-08-19 Thread Bruce Momjian
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Is the uptime kept internally anywhere? Or even the start time? No, and no (at least not in any globally accessible variable). If it is, it would be quite trivial to provide access to it Not really --- in the EXEC_BACKEND case,

Re: [HACKERS] postgres uptime

2004-08-19 Thread Marc G. Fournier
On Thu, 19 Aug 2004, Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Is the uptime kept internally anywhere? Or even the start time? No, and no (at least not in any globally accessible variable). If it is, it would be quite trivial to provide access to it Not really --- in the

Re: [HACKERS] postgres uptime

2004-08-19 Thread Bruce Momjian
Marc G. Fournier wrote: On Thu, 19 Aug 2004, Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Is the uptime kept internally anywhere? Or even the start time? No, and no (at least not in any globally accessible variable). If it is, it would be quite trivial to provide access

Re: [HACKERS] postgres uptime

2004-08-19 Thread Tom Lane
Marc G. Fournier [EMAIL PROTECTED] writes: On Thu, 19 Aug 2004, Tom Lane wrote: I'd like to see more than one person requesting this (and with solider rationales) before it gets added to TODO. If I wanted to be picky I would suggest that knowledge of the server start time might be useful

Re: [HACKERS] postgres uptime

2004-08-19 Thread Tom Lane
Marc G. Fournier [EMAIL PROTECTED] writes: On Fri, 20 Aug 2004, Gavin Sherry wrote: However, I'm not sure why an uptime is all that useful? Bragging rights? :) The folks who have a legitimate interest in that number can surely find it out from ps. What I'm having a hard time with here is the

Re: [HACKERS] postgres uptime

2004-08-19 Thread Marc G. Fournier
On Fri, 20 Aug 2004, Tom Lane wrote: Marc G. Fournier [EMAIL PROTECTED] writes: On Thu, 19 Aug 2004, Tom Lane wrote: I'd like to see more than one person requesting this (and with solider rationales) before it gets added to TODO. If I wanted to be picky I would suggest that knowledge of the

Re: [HACKERS] postgres uptime

2004-08-19 Thread Marc G. Fournier
On Fri, 20 Aug 2004, Tom Lane wrote: Marc G. Fournier [EMAIL PROTECTED] writes: On Fri, 20 Aug 2004, Gavin Sherry wrote: However, I'm not sure why an uptime is all that useful? Bragging rights? :) The folks who have a legitimate interest in that number can surely find it out from ps. What I'm

Re: [HACKERS] postgres uptime

2004-08-19 Thread Tom Lane
Marc G. Fournier [EMAIL PROTECTED] writes: Good point(s) ... but, what would that give an attacker? Being able to isolate the random seed, that is? Well, the random seed determines the salt values that will be used to challenge password logins. So it might help you execute a password-replay