Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQ6Lt-0006x7-5U for pgsql-general@arkaria.postgresql.org; Tue, 05 Jun 2018 07:25:57 +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-0008G6-AX 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 1fQ6GV-0008S1-AU for pgsql-general@lists.postgresql.org; Tue, 05 Jun 2018 07:20:23 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fQ6Bo-0005iI-1H for pgsql-general@postgresql.org; Tue, 05 Jun 2018 07:15:43 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 2B39ED4F21B2 for ; Tue, 5 Jun 2018 00:15:18 -0700 (MST) Date: Tue, 5 Jun 2018 00:15:18 -0700 (MST) From: pavan95 To: pgsql-general@postgresql.org Message-ID: <1528182918174-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 In my view this work meets my requirement. Kindly suggest if it appropriate to do like this. Regards, Pavan -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html