@@ -16899,33 +16899,30 @@ $ ? (@ like_regex "^\\d+$")
16899
16899
<itemizedlist>
16900
16900
<listitem>
16901
16901
<para>
16902
- <xref linkend="functions-jsonobject"/ >
16902
+ <link linkend="functions-jsonobject"><literal>JSON_OBJECT</literal></link >
16903
16903
</para>
16904
16904
</listitem>
16905
16905
<listitem>
16906
16906
<para>
16907
- <xref linkend="functions-jsonobjectagg"/ >
16907
+ <link linkend="functions-jsonobjectagg"><literal>JSON_OBJECTAGG</literal></link >
16908
16908
</para>
16909
16909
</listitem>
16910
16910
<listitem>
16911
16911
<para>
16912
- <xref linkend="functions-jsonarray"/ >
16912
+ <link linkend="functions-jsonarray"><literal>JSON_ARRAY</literal></link >
16913
16913
</para>
16914
16914
</listitem>
16915
16915
<listitem>
16916
16916
<para>
16917
- <xref linkend="functions-jsonarrayagg"/ >
16917
+ <link linkend="functions-jsonarrayagg"><literal>JSON_ARRAYAGG</literal></link >
16918
16918
</para>
16919
16919
</listitem>
16920
16920
</itemizedlist>
16921
16921
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>
16927
16925
16928
- <refsynopsisdiv>
16929
16926
<synopsis>
16930
16927
<function>JSON_OBJECT</function> (
16931
16928
<optional> { <parameter>key_expression</parameter> { VALUE | ':' }
@@ -16934,20 +16931,18 @@ $ ? (@ like_regex "^\\d+$")
16934
16931
<optional> { WITH | WITHOUT } UNIQUE <optional> KEYS </optional> </optional>
16935
16932
<optional> RETURNING <replaceable class="parameter">data_type</replaceable> <optional> FORMAT JSON <optional> ENCODING UTF8 </optional> </optional> </optional>
16936
16933
)
16937
-
16938
16934
</synopsis>
16939
- </refsynopsisdiv>
16940
16935
16941
- <refsect1 >
16936
+ <sect5 >
16942
16937
<title>Description</title>
16943
16938
16944
16939
<para>
16945
16940
<function>JSON_OBJECT</function> function generates a <acronym>JSON</acronym>
16946
16941
object from <acronym>SQL</acronym> or <acronym>JSON</acronym> data.
16947
16942
</para>
16948
- </refsect1 >
16943
+ </sect5 >
16949
16944
16950
- <refsect1 >
16945
+ <sect5 >
16951
16946
<title>Parameters</title>
16952
16947
<variablelist>
16953
16948
@@ -17072,18 +17067,18 @@ $ ? (@ like_regex "^\\d+$")
17072
17067
</varlistentry>
17073
17068
17074
17069
</variablelist>
17075
- </refsect1 >
17070
+ </sect5 >
17076
17071
17077
- <refsect1 >
17072
+ <sect5 >
17078
17073
<title>Notes</title>
17079
17074
<para>Alternatively, you can construct <acronym>JSON</acronym> objects by using
17080
17075
<productname>PostgreSQL</productname>-specific <function>json_build_object()</function>/
17081
17076
<function>jsonb_build_object()</function> functions.
17082
17077
See <xref linkend="functions-json-creation-table"/> for details.
17083
17078
</para>
17084
- </refsect1 >
17079
+ </sect5 >
17085
17080
17086
- <refsect1 >
17081
+ <sect5 >
17087
17082
<title>Examples</title>
17088
17083
<para>
17089
17084
Construct a JSON object from the provided key/value pairs of various types:
@@ -17134,16 +17129,13 @@ WHERE f.did = 103;
17134
17129
{"code" : "P_303", "title" : "48 Hrs", "did" : 103}
17135
17130
(3 rows)
17136
17131
</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>
17145
17134
17146
- <refsynopsisdiv>
17135
+ <sect4 id="functions-jsonobjectagg">
17136
+ <title><literal>JSON_OBJECTAGG</literal></title>
17137
+ <indexterm><primary>json_objectagg</primary></indexterm>
17138
+
17147
17139
<synopsis>
17148
17140
<function>JSON_OBJECTAGG</function> (
17149
17141
<optional> { <parameter>key_expression</parameter> { VALUE | ':' } <parameter>value_expression</parameter> } </optional>
@@ -17153,9 +17145,8 @@ WHERE f.did = 103;
17153
17145
)
17154
17146
17155
17147
</synopsis>
17156
- </refsynopsisdiv>
17157
17148
17158
- <refsect1 >
17149
+ <sect5 >
17159
17150
<title>Description</title>
17160
17151
17161
17152
<para>
@@ -17165,9 +17156,9 @@ WHERE f.did = 103;
17165
17156
or an <command>ORDER BY</command> clause, this function returns a separate JSON object
17166
17157
for each table row.
17167
17158
</para>
17168
- </refsect1 >
17159
+ </sect5 >
17169
17160
17170
- <refsect1 >
17161
+ <sect5 >
17171
17162
<title>Parameters</title>
17172
17163
17173
17164
<variablelist>
@@ -17292,18 +17283,18 @@ WHERE f.did = 103;
17292
17283
</varlistentry>
17293
17284
17294
17285
</variablelist>
17295
- </refsect1 >
17286
+ </sect5 >
17296
17287
17297
- <refsect1 >
17288
+ <sect5 >
17298
17289
<title>Notes</title>
17299
17290
<para>Alternatively, you can create <acronym>JSON</acronym> objects by using
17300
17291
<productname>PostgreSQL</productname>-specific <function>json_object_agg()</function>/
17301
17292
<function>jsonb_object_agg()</function> aggregate functions.
17302
17293
See <xref linkend="functions-aggregate"/> for details.
17303
17294
</para>
17304
- </refsect1 >
17295
+ </sect5 >
17305
17296
17306
- <refsect1 >
17297
+ <sect5 >
17307
17298
<title>Examples</title>
17308
17299
17309
17300
<para>
@@ -17361,16 +17352,13 @@ Drama | { "The Third Man" : "01:44:00", "Becket" : "02:28:00", "War and P
17361
17352
Action | { "Vertigo" : "02:08:00", "48 Hrs" : "01:37:00", "Taxi Driver" : "01:54:00", "Absence of Malice" : "01:55:00" }
17362
17353
(5 rows)
17363
17354
</screen>
17364
- </refsect1 >
17365
- </refentry >
17355
+ </sect5 >
17356
+ </sect4 >
17366
17357
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>
17372
17361
17373
- <refsynopsisdiv>
17374
17362
<synopsis>
17375
17363
<function>JSON_ARRAY</function> (
17376
17364
<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" :
17383
17371
<optional> RETURNING <replaceable class="parameter">data_type</replaceable> <optional> FORMAT JSON <optional> ENCODING UTF8 </optional> </optional> </optional>
17384
17372
)
17385
17373
</synopsis>
17386
- </refsynopsisdiv>
17387
17374
17388
- <refsect1 >
17375
+ <sect5 >
17389
17376
<title>Description</title>
17390
17377
17391
17378
<para>
17392
17379
<function>JSON_ARRAY</function> function constructs a <acronym>JSON</acronym> array from
17393
17380
the provided <acronym>SQL</acronym> or <acronym>JSON</acronym> data.
17394
17381
</para>
17395
- </refsect1 >
17382
+ </sect5 >
17396
17383
17397
- <refsect1 >
17384
+ <sect5 >
17398
17385
<title>Parameters</title>
17399
17386
17400
17387
<variablelist>
@@ -17483,18 +17470,18 @@ Action | { "Vertigo" : "02:08:00", "48 Hrs" : "01:37:00", "Taxi Driver" :
17483
17470
</varlistentry>
17484
17471
17485
17472
</variablelist>
17486
- </refsect1 >
17473
+ </sect5 >
17487
17474
17488
- <refsect1 >
17475
+ <sect5 >
17489
17476
<title>Notes</title>
17490
17477
<para>Alternatively, you can create <acronym>JSON</acronym> arrays by using
17491
17478
<productname>PostgreSQL</productname>-specific <function>json_build_array()</function>/
17492
17479
<function>jsonb_build_array()</function> functions.
17493
17480
See <xref linkend="functions-json"/> for details.
17494
17481
</para>
17495
- </refsect1 >
17482
+ </sect5 >
17496
17483
17497
- <refsect1 >
17484
+ <sect5 >
17498
17485
<title>Examples</title>
17499
17486
<para>
17500
17487
From the <structname>films</structname> table, select some data
@@ -17534,16 +17521,13 @@ AS film_titles;
17534
17521
["Vertigo", "Becket", "48 Hrs"]
17535
17522
(1 row)
17536
17523
</screen>
17537
- </refsect1 >
17538
- </refentry >
17524
+ </sect5 >
17525
+ </sect4 >
17539
17526
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>
17545
17530
17546
- <refsynopsisdiv>
17547
17531
<synopsis>
17548
17532
<function>JSON_ARRAYAGG</function> (
17549
17533
<optional> <parameter>value_expression</parameter> </optional>
@@ -17553,18 +17537,17 @@ AS film_titles;
17553
17537
)
17554
17538
17555
17539
</synopsis>
17556
- </refsynopsisdiv>
17557
17540
17558
- <refsect1 >
17541
+ <sect5 >
17559
17542
<title>Description</title>
17560
17543
17561
17544
<para>
17562
17545
<function>JSON_ARRAYAGG</function> function aggregates the provided <acronym>SQL</acronym>
17563
17546
or <acronym>JSON</acronym> data into a <acronym>JSON</acronym> array.
17564
17547
</para>
17565
- </refsect1 >
17548
+ </sect5 >
17566
17549
17567
- <refsect1 >
17550
+ <sect5 >
17568
17551
<title>Parameters</title>
17569
17552
17570
17553
<variablelist>
@@ -17633,18 +17616,18 @@ AS film_titles;
17633
17616
</varlistentry>
17634
17617
17635
17618
</variablelist>
17636
- </refsect1 >
17619
+ </sect5 >
17637
17620
17638
- <refsect1 >
17621
+ <sect5 >
17639
17622
<title>Notes</title>
17640
17623
<para>Alternatively, you can create <acronym>JSON</acronym> arrays by using
17641
17624
<productname>PostgreSQL</productname>-specific <function>json_agg()</function>/
17642
17625
<function>jsonb_agg()</function> functions.
17643
17626
See <xref linkend="functions-aggregate"/> for details.
17644
17627
</para>
17645
- </refsect1 >
17628
+ </sect5 >
17646
17629
17647
- <refsect1 >
17630
+ <sect5 >
17648
17631
<title>Examples</title>
17649
17632
<para>
17650
17633
Construct an array of film titles sorted in alphabetical order:
@@ -17660,8 +17643,8 @@ FROM films AS f;
17660
17643
["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"]
17661
17644
(1 row)
17662
17645
</screen>
17663
- </refsect1 >
17664
- </refentry >
17646
+ </sect5 >
17647
+ </sect4 >
17665
17648
</sect3>
17666
17649
17667
17650
<sect3 id="sqljson-common-clauses">