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 1oiHUa-0001zo-Mk for pgsql-docs@arkaria.postgresql.org; Tue, 11 Oct 2022 15:48:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oiHUZ-0002Dp-31 for pgsql-docs@arkaria.postgresql.org; Tue, 11 Oct 2022 15:48:27 +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 1oiHUY-0002Df-S9 for pgsql-docs@lists.postgresql.org; Tue, 11 Oct 2022 15:48:26 +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 1oiHUW-0002ox-EM for pgsql-docs@lists.postgresql.org; Tue, 11 Oct 2022 15:48:26 +0000 Received: from bruce by momjian.us with local (Exim 4.94.2) (envelope-from ) id 1oiHUT-000Z5T-7X; Tue, 11 Oct 2022 11:48:21 -0400 Date: Tue, 11 Oct 2022 11:48:21 -0400 From: Bruce Momjian To: alex.denman@nih.gov, pgsql-docs@lists.postgresql.org Subject: Re: JSON/JSONB documentation, aggregate functions Message-ID: References: <166335888474.659.16897487975376230364@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cEa8yyXxoU628VWN" Content-Disposition: inline In-Reply-To: <166335888474.659.16897487975376230364@wrigleys.postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --cEa8yyXxoU628VWN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 16, 2022 at 08:08:04PM +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/14/functions-json.html > Description: > > Regarding the Json documentation (9.16.1: processing and creating JSON > data), I would like to suggest that the reference to > json_agg/jsonb_agg/json_object_agg/jsonb_object_agg (section 9.21) be made > more prominent. When looking through the list of json[b] processing > functions, it's really easy to miss the footnote mentioning the aggregate > functions. The list of functions in table 9.47 includes a lot of functions > that are *really*similar in purpose to the json aggregator functions, and > it's easy to assume that anything related to building JSON[B] objects *must* > be listed there. I just spent hours searching for a way to turn one column > of keys and one column of values into a JSONB object (without coercing all > numeric values to json strings), and I can't imagine I'm the only one. I see your point --- that the aggregate sentence is at the end of the section, after four massive tables. The attached patch moves the paragraph up to the end of the section's introductory paragraph. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Indecision is a decision. Inaction is an action. Mark Batterson --cEa8yyXxoU628VWN Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="agg.diff" diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index b2bdbc7d1c..8dd543a2c1 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -15149,6 +15149,12 @@ table2-mapping jsonb, though not for json. The comparison operators follow the ordering rules for B-tree operations outlined in . + See also for the aggregate + function json_agg which aggregates record + values as JSON, the aggregate function + json_object_agg which aggregates pairs of values + into a JSON object, and their jsonb equivalents, + jsonb_agg and jsonb_object_agg. @@ -16604,15 +16610,6 @@ table2-mapping
- - - See also for the aggregate - function json_agg which aggregates record - values as JSON, the aggregate function - json_object_agg which aggregates pairs of values - into a JSON object, and their jsonb equivalents, - jsonb_agg and jsonb_object_agg. - --cEa8yyXxoU628VWN--