Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kK3qi-0000DX-T1 for pgsql-docs@arkaria.postgresql.org; Sun, 20 Sep 2020 18:14:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kK3qg-0003Bq-ES for pgsql-docs@arkaria.postgresql.org; Sun, 20 Sep 2020 18:14:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kK3qg-0003Bj-93 for pgsql-docs@lists.postgresql.org; Sun, 20 Sep 2020 18:14:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kK3qb-0007F2-Rf for pgsql-docs@lists.postgresql.org; Sun, 20 Sep 2020 18:14:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 08KIE03W878266; Sun, 20 Sep 2020 14:14:00 -0400 From: Tom Lane To: Bruce Momjian cc: "David G. Johnston" , Guyren Howe , Pg Docs Subject: Re: Please provide examples of rows from In-reply-to: <835988.1600613834@sss.pgh.pa.us> References: <158638264419.662.2482095087061084020@wrigleys.postgresql.org> <20200904014618.GB13932@momjian.us> <20200920003910.GA22746@momjian.us> <798909.1600562993@sss.pgh.pa.us> <20200920013846.GC22746@momjian.us> <835988.1600613834@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 20 Sep 2020 10:57:14 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <878264.1600625640.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 20 Sep 2020 14:14:00 -0400 Message-ID: <878265.1600625640@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > You're right that the only suitable core function is going to be > json[b]_to_recordset, but I don't see why you can't extend the > existing example for that. Something like Meh, I was too hasty and pushed "send" with a broken example. Better =3D# select * from rows from (json_to_recordset('[{"a":1,"b":"foo"},{"a":"= 2","b":"bar"}]') as (a int, b text), generate_series(1,3)) as x(p,q,s); p | q | s = ---+-----+--- 1 | foo | 1 2 | bar | 2 | | 3 (3 rows) regards, tom lane