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 1kPX65-0002K7-3y for pgsql-docs@arkaria.postgresql.org; Mon, 05 Oct 2020 20:28:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kPX61-0006ml-8X for pgsql-docs@arkaria.postgresql.org; Mon, 05 Oct 2020 20:28:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPX61-0006mY-33 for pgsql-docs@lists.postgresql.org; Mon, 05 Oct 2020 20:28:33 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPX5y-00084G-MN for pgsql-docs@lists.postgresql.org; Mon, 05 Oct 2020 20:28:32 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kPX5w-0006TC-It; Mon, 05 Oct 2020 16:28:28 -0400 Date: Mon, 5 Oct 2020 16:28:28 -0400 From: Bruce Momjian To: Tom Lane Cc: "David G. Johnston" , Guyren Howe , Pg Docs Subject: Re: Please provide examples of rows from Message-ID: <20201005202828.GC4993@momjian.us> References: <20200904014618.GB13932@momjian.us> <20200920003910.GA22746@momjian.us> <798909.1600562993@sss.pgh.pa.us> <20200920013846.GC22746@momjian.us> <835988.1600613834@sss.pgh.pa.us> <878265.1600625640@sss.pgh.pa.us> <20200924185511.GC22807@momjian.us> <1668963.1600974324@sss.pgh.pa.us> <20200924193714.GD22807@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200924193714.GD22807@momjian.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Sep 24, 2020 at 03:37:14PM -0400, Bruce Momjian wrote: > On Thu, Sep 24, 2020 at 03:05:24PM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > Yes, this is very helpful. I was afraid the JSON would overwhelm the > > > example, but this looks good. I wrote the attached doc patch which I > > > think improves this. I plan to apply it to all supported versions. > > > > Couple thoughts: > > > > * Taking the initial ... out of the syntax synopsis is not an improvement. > > It makes it look like you can only apply AS to the first function of a > > ROWS FROM. > > Oh, so the dots represent optional non-column_definition function calls. > I can't think if a cleaner way to show that, so I guess "..." will have > to do. > > > * I think the ORDER BY adds nothing to the example except complication > > and confusion. > > I wanted to highlight that the column_definition specifies the data type > of the column in other parts of the query. > > > * Maybe the other sentence of explanation would read better as > > > > json_to_recordset() is instructed to return two columns, > > the first integer and the second text. The result of > > generate_series() is used directly. > > OK, better. New patch attached. Patch applied to all supported versions. Thanks to Tom for proposing the example query, and to the original reporter. :-) -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee