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 1fPndE-0002BG-74 for pgsql-admin@arkaria.postgresql.org; Mon, 04 Jun 2018 11:26:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fPnd9-0004Np-9Z for pgsql-admin@arkaria.postgresql.org; Mon, 04 Jun 2018 11:26:31 +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 1fPnd8-0004NB-Ul for pgsql-admin@lists.postgresql.org; Mon, 04 Jun 2018 11:26:31 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fPnd2-0004Q0-1d for pgsql-admin@postgresql.org; Mon, 04 Jun 2018 11:26:29 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id BE1B0D4B8733 for ; Mon, 4 Jun 2018 04:26:21 -0700 (MST) Date: Mon, 4 Jun 2018 04:26:21 -0700 (MST) From: pavan95 To: pgsql-admin@postgresql.org Message-ID: <1528111581735-0.post@n3.nabble.com> Subject: Re: How to get the postmaster shut downtime dynamically and insert into a table? 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 all, In postgres pg_postmaster_start_time() function gives us the time when postmaster was last restarted. Similarly, My requirement is to get the time when the postmaster has stopped and the duration it has taken for the start of the server. AFAIK, the shutdown time is present in the log file alone. Is there any function wherein which we can get the stop time of the postmaster. My requirement is to dynamically store the shutdown time into a table whenever postmaster shutdowns. Any help in achieving this would be really great. Regards, Pavan -- Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html