Skip to content

Commit b46bcf7

Browse files
committed
Improve readability of SQL/JSON documentation.
Per review from Justin Pryzby. Discussion: https://postgr.es/m/f50aca87-6b35-a1b0-2286-f815a589dd83@dunslane.net
1 parent c215cc7 commit b46bcf7

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

doc/src/sgml/func.sgml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17764,7 +17764,7 @@ $.* ? (@ like_regex "^\\d+$")
1776417764
<sect5>
1776517765
<title>Examples</title>
1776617766
<para>
17767-
Construct a JSON the provided strings:
17767+
Construct JSON using the provided strings:
1776817768
</para>
1776917769
<screen>
1777017770
SELECT JSON('{ "a" : 123, "b": [ true, "foo" ], "a" : "bar" }');
@@ -17819,7 +17819,7 @@ ERROR: duplicate JSON object key value
1781917819
<acronym>JSON</acronym> value.
1782017820
For null input, <acronym>SQL</acronym> null
1782117821
(not a <acronym>JSON</acronym> null) value is returned.
17822-
For any scalar other than a number or a Boolean the text
17822+
For any scalar other than a number or a Boolean, the text
1782317823
representation will be used, with escaping as necessary to make
1782417824
it a valid <acronym>JSON</acronym> string value.
1782517825
For details, see
@@ -17855,7 +17855,7 @@ ERROR: duplicate JSON object key value
1785517855
<sect5>
1785617856
<title>Examples</title>
1785717857
<para>
17858-
Construct a JSON from the provided values various types:
17858+
Construct JSON scalars from the provided values of various types:
1785917859
</para>
1786017860
<screen>
1786117861
SELECT JSON_SCALAR(123.45);
@@ -18113,9 +18113,7 @@ WHERE f.did = 103;
1811318113
<para>
1811418114
The <function>JSON_OBJECTAGG</function> function aggregates the provided data
1811518115
into a <acronym>JSON</acronym> object. You can use this function to combine values
18116-
stored in different table columns into pairs. If you specify a <command>GROUP BY</command>
18117-
or an <command>ORDER BY</command> clause, this function returns a separate JSON object
18118-
for each table row.
18116+
stored in different table columns into pairs.
1811918117
</para>
1812018118
</sect5>
1812118119

@@ -18691,7 +18689,7 @@ INSERT INTO my_films VALUES (
1869118689
<title>Description</title>
1869218690

1869318691
<para>
18694-
<function>JSON_EXISTS</function> function checks whether the provided
18692+
The <function>JSON_EXISTS</function> function checks whether the provided
1869518693
<acronym>JSON</acronym> path expression can return any <acronym>SQL/JSON</acronym> items.
1869618694
</para>
1869718695
</sect5>
@@ -18804,7 +18802,7 @@ SELECT JSON_EXISTS(jsonb '{"a": [1,2,3]}', 'strict $.a[5]');
1880418802
<title>Description</title>
1880518803

1880618804
<para>
18807-
<function>JSON_VALUE</function> function extracts a value from the provided
18805+
The <function>JSON_VALUE</function> function extracts a value from the provided
1880818806
<acronym>JSON</acronym> data and converts it to an <acronym>SQL</acronym> scalar.
1880918807
If the specified JSON path expression returns more than one
1881018808
<acronym>SQL/JSON</acronym> item, an error occurs. To extract
@@ -18963,7 +18961,7 @@ SELECT JSON_VALUE(jsonb '[1,2]', 'strict $[*]' DEFAULT 1 ON ERROR);
1896318961
<title>Description</title>
1896418962

1896518963
<para>
18966-
<function>JSON_QUERY</function> function extracts an <acronym>SQL/JSON</acronym>
18964+
The <function>JSON_QUERY</function> function extracts an <acronym>SQL/JSON</acronym>
1896718965
array or object from <acronym>JSON</acronym> data. This function must return
1896818966
a JSON string, so if the path expression returns a scalar or multiple SQL/JSON
1896918967
items, you must wrap the result using the <literal>WITH WRAPPER</literal> clause.
@@ -19366,7 +19364,7 @@ where <replaceable class="parameter">json_table_column</replaceable> is:
1936619364
<title>Description</title>
1936719365

1936819366
<para>
19369-
<function>JSON_TABLE</function> function queries <acronym>JSON</acronym> data
19367+
The <function>JSON_TABLE</function> function queries <acronym>JSON</acronym> data
1937019368
and presents the results as a relational view, which can be accessed as a
1937119369
regular SQL table. You can only use <function>JSON_TABLE</function> inside the
1937219370
<literal>FROM</literal> clause of the <literal>SELECT</literal> statement
@@ -19620,7 +19618,7 @@ where <replaceable class="parameter">json_table_column</replaceable> is:
1962019618
<para>
1962119619
The optional <replaceable>json_path_name</replaceable> serves as an
1962219620
identifier of the provided <replaceable>json_path_specification</replaceable>.
19623-
The path name must be unique and cannot coincide with column names.
19621+
The path name must be unique and distinct from the column names.
1962419622
When using the <literal>PLAN</literal> clause, you must specify the names
1962519623
for all the paths, including the row pattern. Each path name can appear in
1962619624
the <literal>PLAN</literal> clause only once.
@@ -19820,7 +19818,7 @@ JSON_SERIALIZE (
1982019818
<title>Description</title>
1982119819

1982219820
<para>
19823-
<function>JSON_SERIALIZE</function> function transforms a SQL/JSON value
19821+
The <function>JSON_SERIALIZE</function> function transforms a SQL/JSON value
1982419822
into a character or binary string.
1982519823
</para>
1982619824
</sect5>
@@ -19872,7 +19870,7 @@ JSON_SERIALIZE (
1987219870
<sect5>
1987319871
<title>Examples</title>
1987419872
<para>
19875-
Construct a JSON the provided strings:
19873+
Construct serialized JSON using the provided strings:
1987619874
</para>
1987719875
<screen>
1987819876
SELECT JSON_SERIALIZE(JSON_SCALAR('foo'));
@@ -19961,7 +19959,7 @@ SELECT JSON_SERIALIZE('{"foo": "bar", "baz": [1, 2]}' RETURNING bytea);
1996119959
supports the following types: <type>json</type>, <type>jsonb</type>,
1996219960
<type>bytea</type>, and character string types (<type>text</type>, <type>char</type>,
1996319961
<type>varchar</type>, and <type>nchar</type>).
19964-
To use other types, you must create the <literal>CAST</literal> from <type>json</type> for this type.
19962+
To use another type, you must create a cast from <type>json</type> to that type.
1996519963
By default, the <type>json</type> type is returned.
1996619964
</para>
1996719965
<para>
@@ -22392,7 +22390,7 @@ SELECT NULLIF(value, '(none)') ...
2239222390
Collects all the key/value pairs into a JSON object. Key arguments
2239322391
are coerced to text; value arguments are converted as per
2239422392
<function>to_json</function> or <function>to_jsonb</function>
22395-
Values can be null, but not keys.
22393+
Values can be null, but keys cannot.
2239622394
</para></entry>
2239722395
<entry>No</entry>
2239822396
</row>
@@ -22449,7 +22447,7 @@ SELECT NULLIF(value, '(none)') ...
2244922447
Collects all the key/value pairs into a JSON object. Key arguments
2245022448
are coerced to text; value arguments are converted as per
2245122449
<function>to_json</function> or <function>to_jsonb</function>.
22452-
Values can be null, but not keys.
22450+
Values can be null, but keys cannot.
2245322451
If there is a duplicate key an error is thrown.
2245422452
</para></entry>
2245522453
<entry>No</entry>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy