Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWMf7-0006mG-Qt for pgsql-general@arkaria.postgresql.org; Mon, 10 Dec 2018 14:35: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 1gWMf6-000685-Ik for pgsql-general@arkaria.postgresql.org; Mon, 10 Dec 2018 14:35:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWMf6-00067x-AT for pgsql-general@lists.postgresql.org; Mon, 10 Dec 2018 14:35:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWMez-0003R7-Ow for pgsql-general@lists.postgresql.org; Mon, 10 Dec 2018 14:35:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wBAEZhI2023176; Mon, 10 Dec 2018 09:35:44 -0500 From: Tom Lane To: Ian Barwick cc: Michael Paquier , Ron , pgsql-general@lists.postgresql.org Subject: Re: Tables(s) that feed pg_controldata In-reply-to: References: <62c43250-70ad-479b-d3ef-9860114eba43@gmail.com> <30d70181-bed1-9c33-f604-30d68d78dc2c@gmail.com> <20181210025029.GB1105@paquier.xyz> Comments: In-reply-to Ian Barwick message dated "Mon, 10 Dec 2018 12:16:32 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23174.1544452543.1@sss.pgh.pa.us> Date: Mon, 10 Dec 2018 09:35:43 -0500 Message-ID: <23175.1544452543@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ian Barwick writes: > On 12/10/2018 11:50 AM, Michael Paquier wrote: >> Perhaps. Even with that, writing an extension for 9.2 would require >> copy-pasting a lot of code from pg_controldata.c and taking as well the >> code which has been introduced for the various control functions. >> Dirty, still doable. > I've got some code which does just that to read pg_control as far > back as 9.3, and it is indeed not pretty ;). If I had to do this pre-9.6, I'd write a function in an untrusted PL that invoked pg_controldata and parsed its output. Ugly, but short and easy to port across versions. regards, tom lane