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 1imodE-0003KO-0T for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jan 2020 00:46:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1imodC-0000vn-Fn for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jan 2020 00:46:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1imodC-0000vg-48 for pgsql-hackers@lists.postgresql.org; Thu, 02 Jan 2020 00:46:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1imod9-0004l5-JR for pgsql-hackers@postgresql.org; Thu, 02 Jan 2020 00:46:28 +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 0020kFp3007438; Wed, 1 Jan 2020 19:46:16 -0500 From: Tom Lane To: David Fetter cc: Robert Haas , David Steele , Tels , Suraj Kharage , Rushabh Lathia , Andrew Dunstan , PostgreSQL Hackers , Jeevan Chalke , vignesh C Subject: Re: backup manifests In-reply-to: <20200101190917.GR32763@fetter.org> References: <20191231174325.GQ32763@fetter.org> <7cb79c9e-8377-b2b5-3fa4-9775e1aca1fe@pgmasters.net> <20200101190917.GR32763@fetter.org> Comments: In-reply-to David Fetter message dated "Wed, 01 Jan 2020 20:09:18 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7436.1577925975.1@sss.pgh.pa.us> Date: Wed, 01 Jan 2020 19:46:15 -0500 Message-ID: <7437.1577925975@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Fetter writes: > On Wed, Jan 01, 2020 at 01:43:40PM -0500, Robert Haas wrote: >> So, if someone can suggest to me how I could read JSON from a tool in >> src/bin without writing a lot of code, I'm all ears. > Maybe I'm missing something obvious, but wouldn't combining > pg_read_file() with a cast to JSONB fix this, as below? Only if you're prepared to restrict the use of the tool to superusers (or at least people with whatever privilege that function requires). Admittedly, you can probably feed the data to the backend without use of an intermediate file; but it still requires a working backend connection, which might be a bit of a leap for backup-related tools. I'm sure Robert was envisioning doing this processing inside the tool. regards, tom lane