@@ -16899,33 +16899,30 @@ $ ? (@ like_regex "^\\d+$")
1689916899 <itemizedlist>
1690016900 <listitem>
1690116901 <para>
16902- <xref linkend="functions-jsonobject"/ >
16902+ <link linkend="functions-jsonobject"><literal>JSON_OBJECT</literal></link >
1690316903 </para>
1690416904 </listitem>
1690516905 <listitem>
1690616906 <para>
16907- <xref linkend="functions-jsonobjectagg"/ >
16907+ <link linkend="functions-jsonobjectagg"><literal>JSON_OBJECTAGG</literal></link >
1690816908 </para>
1690916909 </listitem>
1691016910 <listitem>
1691116911 <para>
16912- <xref linkend="functions-jsonarray"/ >
16912+ <link linkend="functions-jsonarray"><literal>JSON_ARRAY</literal></link >
1691316913 </para>
1691416914 </listitem>
1691516915 <listitem>
1691616916 <para>
16917- <xref linkend="functions-jsonarrayagg"/ >
16917+ <link linkend="functions-jsonarrayagg"><literal>JSON_ARRAYAGG</literal></link >
1691816918 </para>
1691916919 </listitem>
1692016920 </itemizedlist>
1692116921
16922- <refentry id="functions-jsonobject">
16923- <refnamediv>
16924- <refname>JSON_OBJECT</refname>
16925- <refpurpose>create a JSON object</refpurpose>
16926- </refnamediv>
16922+ <sect4 id="functions-jsonobject">
16923+ <title><literal>JSON_OBJECT</literal></title>
16924+ <indexterm><primary>json_object</primary></indexterm>
1692716925
16928- <refsynopsisdiv>
1692916926<synopsis>
1693016927<function>JSON_OBJECT</function> (
1693116928 <optional> { <parameter>key_expression</parameter> { VALUE | ':' }
@@ -16934,20 +16931,18 @@ $ ? (@ like_regex "^\\d+$")
1693416931 <optional> { WITH | WITHOUT } UNIQUE <optional> KEYS </optional> </optional>
1693516932 <optional> RETURNING <replaceable class="parameter">data_type</replaceable> <optional> FORMAT JSON <optional> ENCODING UTF8 </optional> </optional> </optional>
1693616933)
16937-
1693816934</synopsis>
16939- </refsynopsisdiv>
1694016935
16941- <refsect1 >
16936+ <sect5 >
1694216937 <title>Description</title>
1694316938
1694416939 <para>
1694516940 <function>JSON_OBJECT</function> function generates a <acronym>JSON</acronym>
1694616941 object from <acronym>SQL</acronym> or <acronym>JSON</acronym> data.
1694716942 </para>
16948- </refsect1 >
16943+ </sect5 >
1694916944
16950- <refsect1 >
16945+ <sect5 >
1695116946 <title>Parameters</title>
1695216947 <variablelist>
1695316948
@@ -17072,18 +17067,18 @@ $ ? (@ like_regex "^\\d+$")
1707217067 </varlistentry>
1707317068
1707417069 </variablelist>
17075- </refsect1 >
17070+ </sect5 >
1707617071
17077- <refsect1 >
17072+ <sect5 >
1707817073 <title>Notes</title>
1707917074 <para>Alternatively, you can construct <acronym>JSON</acronym> objects by using
1708017075 <productname>PostgreSQL</productname>-specific <function>json_build_object()</function>/
1708117076 <function>jsonb_build_object()</function> functions.
1708217077 See <xref linkend="functions-json-creation-table"/> for details.
1708317078 </para>
17084- </refsect1 >
17079+ </sect5 >
1708517080
17086- <refsect1 >
17081+ <sect5 >
1708717082 <title>Examples</title>
1708817083 <para>
1708917084 Construct a JSON object from the provided key/value pairs of various types:
@@ -17134,16 +17129,13 @@ WHERE f.did = 103;
1713417129{"code" : "P_303", "title" : "48 Hrs", "did" : 103}
1713517130(3 rows)
1713617131</screen>
17137- </refsect1>
17138- </refentry>
17139-
17140- <refentry id="functions-jsonobjectagg">
17141- <refnamediv>
17142- <refname>JSON_OBJECTAGG</refname>
17143- <refpurpose>create a JSON object as an aggregate of the provided data</refpurpose>
17144- </refnamediv>
17132+ </sect5>
17133+ </sect4>
1714517134
17146- <refsynopsisdiv>
17135+ <sect4 id="functions-jsonobjectagg">
17136+ <title><literal>JSON_OBJECTAGG</literal></title>
17137+ <indexterm><primary>json_objectagg</primary></indexterm>
17138+
1714717139<synopsis>
1714817140<function>JSON_OBJECTAGG</function> (
1714917141 <optional> { <parameter>key_expression</parameter> { VALUE | ':' } <parameter>value_expression</parameter> } </optional>
@@ -17153,9 +17145,8 @@ WHERE f.did = 103;
1715317145)
1715417146
1715517147</synopsis>
17156- </refsynopsisdiv>
1715717148
17158- <refsect1 >
17149+ <sect5 >
1715917150 <title>Description</title>
1716017151
1716117152 <para>
@@ -17165,9 +17156,9 @@ WHERE f.did = 103;
1716517156 or an <command>ORDER BY</command> clause, this function returns a separate JSON object
1716617157 for each table row.
1716717158 </para>
17168- </refsect1 >
17159+ </sect5 >
1716917160
17170- <refsect1 >
17161+ <sect5 >
1717117162 <title>Parameters</title>
1717217163
1717317164 <variablelist>
@@ -17292,18 +17283,18 @@ WHERE f.did = 103;
1729217283 </varlistentry>
1729317284
1729417285 </variablelist>
17295- </refsect1 >
17286+ </sect5 >
1729617287
17297- <refsect1 >
17288+ <sect5 >
1729817289 <title>Notes</title>
1729917290 <para>Alternatively, you can create <acronym>JSON</acronym> objects by using
1730017291 <productname>PostgreSQL</productname>-specific <function>json_object_agg()</function>/
1730117292 <function>jsonb_object_agg()</function> aggregate functions.
1730217293 See <xref linkend="functions-aggregate"/> for details.
1730317294 </para>
17304- </refsect1 >
17295+ </sect5 >
1730517296
17306- <refsect1 >
17297+ <sect5 >
1730717298 <title>Examples</title>
1730817299
1730917300 <para>
@@ -17361,16 +17352,13 @@ Drama | { "The Third Man" : "01:44:00", "Becket" : "02:28:00", "War and P
1736117352Action | { "Vertigo" : "02:08:00", "48 Hrs" : "01:37:00", "Taxi Driver" : "01:54:00", "Absence of Malice" : "01:55:00" }
1736217353(5 rows)
1736317354</screen>
17364- </refsect1 >
17365- </refentry >
17355+ </sect5 >
17356+ </sect4 >
1736617357
17367- <refentry id="functions-jsonarray">
17368- <refnamediv>
17369- <refname>JSON_ARRAY</refname>
17370- <refpurpose>create a JSON array</refpurpose>
17371- </refnamediv>
17358+ <sect4 id="functions-jsonarray">
17359+ <title><literal>JSON_ARRAY</literal></title>
17360+ <indexterm><primary>json_array</primary></indexterm>
1737217361
17373- <refsynopsisdiv>
1737417362<synopsis>
1737517363<function>JSON_ARRAY</function> (
1737617364 <optional> { <parameter>value_expression</parameter> <optional> FORMAT JSON </optional> } <optional>, ...</optional> </optional>
@@ -17383,18 +17371,17 @@ Action | { "Vertigo" : "02:08:00", "48 Hrs" : "01:37:00", "Taxi Driver" :
1738317371 <optional> RETURNING <replaceable class="parameter">data_type</replaceable> <optional> FORMAT JSON <optional> ENCODING UTF8 </optional> </optional> </optional>
1738417372)
1738517373</synopsis>
17386- </refsynopsisdiv>
1738717374
17388- <refsect1 >
17375+ <sect5 >
1738917376 <title>Description</title>
1739017377
1739117378 <para>
1739217379 <function>JSON_ARRAY</function> function constructs a <acronym>JSON</acronym> array from
1739317380 the provided <acronym>SQL</acronym> or <acronym>JSON</acronym> data.
1739417381 </para>
17395- </refsect1 >
17382+ </sect5 >
1739617383
17397- <refsect1 >
17384+ <sect5 >
1739817385 <title>Parameters</title>
1739917386
1740017387 <variablelist>
@@ -17483,18 +17470,18 @@ Action | { "Vertigo" : "02:08:00", "48 Hrs" : "01:37:00", "Taxi Driver" :
1748317470 </varlistentry>
1748417471
1748517472</variablelist>
17486- </refsect1 >
17473+ </sect5 >
1748717474
17488- <refsect1 >
17475+ <sect5 >
1748917476 <title>Notes</title>
1749017477 <para>Alternatively, you can create <acronym>JSON</acronym> arrays by using
1749117478 <productname>PostgreSQL</productname>-specific <function>json_build_array()</function>/
1749217479 <function>jsonb_build_array()</function> functions.
1749317480 See <xref linkend="functions-json"/> for details.
1749417481 </para>
17495- </refsect1 >
17482+ </sect5 >
1749617483
17497- <refsect1 >
17484+ <sect5 >
1749817485 <title>Examples</title>
1749917486 <para>
1750017487 From the <structname>films</structname> table, select some data
@@ -17534,16 +17521,13 @@ AS film_titles;
1753417521["Vertigo", "Becket", "48 Hrs"]
1753517522(1 row)
1753617523</screen>
17537- </refsect1 >
17538- </refentry >
17524+ </sect5 >
17525+ </sect4 >
1753917526
17540- <refentry id="functions-jsonarrayagg">
17541- <refnamediv>
17542- <refname>JSON_ARRAYAGG</refname>
17543- <refpurpose>aggregate a JSON array</refpurpose>
17544- </refnamediv>
17527+ <sect4 id="functions-jsonarrayagg">
17528+ <title><literal>JSON_ARRAYAGG</literal></title>
17529+ <indexterm><primary>json_arrayagg</primary></indexterm>
1754517530
17546- <refsynopsisdiv>
1754717531<synopsis>
1754817532<function>JSON_ARRAYAGG</function> (
1754917533 <optional> <parameter>value_expression</parameter> </optional>
@@ -17553,18 +17537,17 @@ AS film_titles;
1755317537)
1755417538
1755517539</synopsis>
17556- </refsynopsisdiv>
1755717540
17558- <refsect1 >
17541+ <sect5 >
1755917542 <title>Description</title>
1756017543
1756117544 <para>
1756217545 <function>JSON_ARRAYAGG</function> function aggregates the provided <acronym>SQL</acronym>
1756317546 or <acronym>JSON</acronym> data into a <acronym>JSON</acronym> array.
1756417547 </para>
17565- </refsect1 >
17548+ </sect5 >
1756617549
17567- <refsect1 >
17550+ <sect5 >
1756817551 <title>Parameters</title>
1756917552
1757017553 <variablelist>
@@ -17633,18 +17616,18 @@ AS film_titles;
1763317616 </varlistentry>
1763417617
1763517618</variablelist>
17636- </refsect1 >
17619+ </sect5 >
1763717620
17638- <refsect1 >
17621+ <sect5 >
1763917622 <title>Notes</title>
1764017623 <para>Alternatively, you can create <acronym>JSON</acronym> arrays by using
1764117624 <productname>PostgreSQL</productname>-specific <function>json_agg()</function>/
1764217625 <function>jsonb_agg()</function> functions.
1764317626 See <xref linkend="functions-aggregate"/> for details.
1764417627 </para>
17645- </refsect1 >
17628+ </sect5 >
1764617629
17647- <refsect1 >
17630+ <sect5 >
1764817631 <title>Examples</title>
1764917632 <para>
1765017633 Construct an array of film titles sorted in alphabetical order:
@@ -17660,8 +17643,8 @@ FROM films AS f;
1766017643["48 Hrs", "Absence of Malice", "Bananas", "Becket", "Bed Knobs and Broomsticks", "Das Boot", "Storia di una donna", "Taxi Driver", "The African Queen", "The King and I", "There's a Girl in my Soup", "The Third Man", "Une Femme est une Femme", "Vertigo", "War and Peace", "West Side Story", "Yojimbo"]
1766117644(1 row)
1766217645</screen>
17663- </refsect1 >
17664- </refentry >
17646+ </sect5 >
17647+ </sect4 >
1766517648 </sect3>
1766617649
1766717650 <sect3 id="sqljson-common-clauses">
0 commit comments