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 1kK0mI-00016l-GN for pgsql-docs@arkaria.postgresql.org; Sun, 20 Sep 2020 14:57:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kK0mH-0003jw-0r for pgsql-docs@arkaria.postgresql.org; Sun, 20 Sep 2020 14:57:21 +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 1kK0mG-0003jn-RK for pgsql-docs@lists.postgresql.org; Sun, 20 Sep 2020 14:57:20 +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 1kK0mE-0005aY-Ku for pgsql-docs@lists.postgresql.org; Sun, 20 Sep 2020 14:57:19 +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 08KEvEc4835989; Sun, 20 Sep 2020 10:57:14 -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: <20200920013846.GC22746@momjian.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> Comments: In-reply-to Bruce Momjian message dated "Sat, 19 Sep 2020 21:38:46 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <835987.1600613834.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 20 Sep 2020 10:57:14 -0400 Message-ID: <835988.1600613834@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bruce Momjian writes: > but doing this to illustrate ROWS FROM is going to be complex. 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 # select * from rows from (json_to_recordset('[{"a":1,"b":"foo"},{"a":"2",= "c":"bar"}]') as (x int, y text), generate_series(1,3)) as x(a,b,s) ; a | b | s = ---+-----+--- 1 | foo | 1 2 | | 2 | | 3 (3 rows) would illustrate all the principles. regards, tom lane