Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQ6Lu-0006x9-VC for pgsql-general@arkaria.postgresql.org; Tue, 05 Jun 2018 07:25:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fQ6Lr-0008G4-B1 for pgsql-general@arkaria.postgresql.org; Tue, 05 Jun 2018 07:25:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQ6Gd-0008S1-7Y for pgsql-general@lists.postgresql.org; Tue, 05 Jun 2018 07:20:31 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fQ5yb-0005SA-Kx for pgsql-general@postgresql.org; Tue, 05 Jun 2018 07:02:08 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id EAAAED4F1759 for ; Tue, 5 Jun 2018 00:01:51 -0700 (MST) Date: Tue, 5 Jun 2018 00:01:51 -0700 (MST) From: pavan95 To: pgsql-general@postgresql.org Message-ID: <1528182111958-0.post@n3.nabble.com> In-Reply-To: <31954.1528133472@sss.pgh.pa.us> References: <1528118250600-0.post@n3.nabble.com> <1528119860207-0.post@n3.nabble.com> <31954.1528133472@sss.pgh.pa.us> Subject: Re: How to get postmaster shut down time in postgres? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 server. It works perfectly fine and the sample output is shown as below: reported | shutdown_time | startup_time ---------------------------------+--------------------------+---------------------------------- 2018-06-05 12:15:00.63332 | /2018-06-05 12:15:00/ | 2018-06-05 12:09:57.625046+05:30 | | 2018-06-05 12:15:05.28899+05:30 Where the shutdown time in the first row is the latest shutdown time and second row startup time is the server start time. I hope this will suffice my requirement. If you have found anything wrong in this kindly correct me. Regards, Pavan -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html