Re: How to get postmaster shut down time in postgres?

2018-06-05 Thread pavan95
Hi Tom Lane, I'm glad that I got a reply from you. And yes you are exactly correct. I am looking for the time that shutdown begins. I fulfilled my requirement by adding a piece of code before the initiation of shutdown in the postgresql service file located in /etc/init.d folder of my ubuntu

Re: How to get postmaster shut down time in postgres?

2018-06-05 Thread pavan95
Hi Tom Lane, I'm glad that I got a reply from you. And yes you are exactly correct. I am looking for the time that shutdown begins. I fulfilled my requirement by adding a piece of code before the initiation of shutdown in the postgresql service file located in /etc/init.d folder of my ubuntu

Re: How to get postmaster shut down time in postgres?

2018-06-05 Thread pavan95
Hi Tom Lane, I'm glad that I got a reply from you. And yes you are exactly correct. I am looking for the time that shutdown begins. I fulfilled my requirement by adding a piece of code before the initiation of shutdown in the postgresql service file located in /etc/init.d folder of my ubuntu

Re: How to get postmaster shut down time in postgres?

2018-06-04 Thread Tom Lane
"David G. Johnston" writes: > On Mon, Jun 4, 2018 at 6:44 AM, pavan95 wrote: >> The main reason for my requirement is to find the time swing between server >> stop and start. > Not all server stops are logged/evented (i.e., crashes), though by > definition all successful starts are (or at least

Re: How to get postmaster shut down time in postgres?

2018-06-04 Thread David G. Johnston
On Mon, Jun 4, 2018 at 6:44 AM, pavan95 wrote: > The main reason for my requirement is to find the time swing between server > stop and start. > ​Not all server stops are logged/evented (i.e., crashes), though by definition all successful starts are (or at least can be).​ David J.

Re: How to get postmaster shut down time in postgres?

2018-06-04 Thread Fabio Pardi
If i were you, i would parse the logfile as others already mentioned. It is easy and clean. Another option might be to modify the init script and add a timestamp to a file whenever it stops/starts your server. Or maybe you can add to the init file a script that fills in your table, but i m not

Re: How to get postmaster shut down time in postgres?

2018-06-04 Thread Ron
On 06/04/2018 08:44 AM, pavan95 wrote: Hi Adrian/Melvin, Thanks for your prompt replies. Yeah, I'm aware of that way. But my requirement is to get the server shutdown time whenever that event occurs and insert into a table dynamically!! Is it possible? You want to trap the shutdown action

Re: How to get postmaster shut down time in postgres?

2018-06-04 Thread Pavan Teja
Thank you so much for your replies. On Mon, Jun 4, 2018, 7:25 PM Adrian Klaver wrote: > On 06/04/2018 06:44 AM, pavan95 wrote: > > Hi Adrian/Melvin, > > > > Thanks for your prompt replies. Yeah, I'm aware of that way. > > > > But my requirement is to get the server shutdown time whenever that

Re: How to get postmaster shut down time in postgres?

2018-06-04 Thread Adrian Klaver
On 06/04/2018 06:44 AM, pavan95 wrote: Hi Adrian/Melvin, Thanks for your prompt replies. Yeah, I'm aware of that way. But my requirement is to get the server shutdown time whenever that event occurs and insert into a table dynamically!! Is it possible? A quick scan shows no built in function

Re: How to get postmaster shut down time in postgres?

2018-06-04 Thread Melvin Davidson
On Mon, Jun 4, 2018 at 9:44 AM, pavan95 wrote: > Hi Adrian/Melvin, > > Thanks for your prompt replies. Yeah, I'm aware of that way. > > But my requirement is to get the server shutdown time whenever that event > occurs and insert into a table dynamically!! Is it possible? > > The main reason for

Re: How to get postmaster shut down time in postgres?

2018-06-04 Thread pavan95
Hi Adrian/Melvin, Thanks for your prompt replies. Yeah, I'm aware of that way. But my requirement is to get the server shutdown time whenever that event occurs and insert into a table dynamically!! Is it possible? The main reason for my requirement is to find the time swing between server stop

Re: How to get postmaster shut down time in postgres?

2018-06-04 Thread Melvin Davidson
On Mon, Jun 4, 2018 at 9:17 AM, pavan95 wrote: > Hi all, > > Is there any way to get postmaster(postgres database) shutdown time? > Please > help!! > > Thanks in Advance. > > > Regards, > Pavan > > > > -- > Sent from: http://www.postgresql-archive.org/PostgreSQL-general- > f1843780.html > > Look

Re: How to get postmaster shut down time in postgres?

2018-06-04 Thread Adrian Klaver
On 06/04/2018 06:17 AM, pavan95 wrote: Hi all, Is there any way to get postmaster(postgres database) shutdown time? Please help!! Assuming you have the Postgres logging turned on it will be in the log: The log when the server was shutdown: 2018-06-03 21:11:41.739 PDT-0LOG: database system