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 1imjN4-0005ru-4p for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jan 2020 19:09:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1imjN2-0003C3-49 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jan 2020 19:09:28 +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 1imjN1-0003A0-9X for pgsql-hackers@lists.postgresql.org; Wed, 01 Jan 2020 19:09:27 +0000 Received: from xvm-110-146.dc2.ghst.net ([46.226.110.146] helo=fetter.org) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1imjMu-00020U-AF for pgsql-hackers@postgresql.org; Wed, 01 Jan 2020 19:09:26 +0000 Received: by fetter.org (Postfix, from userid 1001) id 8CF8F404D5; Wed, 1 Jan 2020 20:09:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fetter.org; s=default; t=1577905758; bh=BSyCDt06iT/R1QRGHm87aJFQUH/PT6jEzGPFFtESmA8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dYJw+kFXlzeuai7c69+6+thwnL8+BsKBehLmnf2mrU4I4+MskVZFMdtRVNmSuFWEA fhA4VMjkhJYW8D7/LJhsnVCfkNQYnGLeWcmT7ICi04abHoTez5ZyWQFWHR1u/6j7qh /g/Ab8gkmf5QC6VJWmuVeDm8m5pcHHDizSdMnw3UU7tX37hjhPXOopUP/NpOWKyaXO s5D/blxG9IiRrLU7LQbguvLXPM04MqUEJJb9+xn/Z5oOVWUKTvaxDCNDbv249iaCE5 6hUhn0Zv5bpcQLHnZJbWRoHF/SW+hIfCh1dA2iyozm2CZynXMCMFISaJaID2TLSPog HorNvz7Sn1xkw== Date: Wed, 1 Jan 2020 20:09:18 +0100 From: David Fetter To: Robert Haas Cc: David Steele , Tels , Suraj Kharage , Rushabh Lathia , Andrew Dunstan , PostgreSQL Hackers , Jeevan Chalke , vignesh C Subject: Re: backup manifests Message-ID: <20200101190917.GR32763@fetter.org> References: <20191231174325.GQ32763@fetter.org> <7cb79c9e-8377-b2b5-3fa4-9775e1aca1fe@pgmasters.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Jan 01, 2020 at 01:43:40PM -0500, Robert Haas wrote: > On Tue, Dec 31, 2019 at 9:16 PM David Steele wrote: > > > That said, I agree that there's no reason to come up with a bespoke > > > format and parser when JSON is already available in every PostgreSQL > > > installation. Imposing a structure atop that includes a version > > > number, as you suggest, seems pretty straightforward, and should be > > > done. > > > > +1. I continue to support a format that would be easily readable > > without writing a lot of code. > > 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. So far that's > been asserted but not been demonstrated to be possible. Getting the > JSON parser that we have in the backend to work from frontend doesn't > look all that straightforward, for reasons that I talked about in > http://postgr.es/m/CA+TgmobZrNYR-ATtfZiZ_k-W7tSPgvmYZmyiqumQig4R4fkzHw@mail.gmail.com Maybe I'm missing something obvious, but wouldn't combining pg_read_file() with a cast to JSONB fix this, as below? shackle@[local]:5413/postgres(13devel)(892328) # SELECT jsonb_pretty(j::jsonb) FROM pg_read_file('/home/shackle/advanced_comparison.json') AS t(j); jsonb_pretty ════════════════════════════════════ [ ↵ { ↵ "message": "hello world!",↵ "severity": "[DEBUG]" ↵ }, ↵ { ↵ "message": "boz", ↵ "severity": "[INFO]" ↵ }, ↵ { ↵ "message": "foo", ↵ "severity": "[DEBUG]" ↵ }, ↵ { ↵ "message": "null", ↵ "severity": "null" ↵ } ↵ ] (1 row) Time: 3.050 ms > As to the suggestion that a version number be included, that's been > there in every version of the patch I've posted. and thanks for that! Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate