Skip to content

Commit 7eff313

Browse files
committed
doc: clarify that jsonb_path_match() returns an SQL boolean
Not a JSON boolean. Also clarify that other predicate check expressions functions return a JSON boolean, not an SQL boolean. Reported-by: jian he Discussion: https://postgr.es/m/CACJufxH7tP1NXCHN1bUBXcEB=dv7-qE+ZjB3UxwK6Em+9Qzb9Q@mail.gmail.com Backpatch-through: 17
1 parent fea81ae commit 7eff313

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/src/sgml/func.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17125,8 +17125,8 @@ ERROR: value too long for type character(2)
1712517125
<returnvalue>boolean</returnvalue>
1712617126
</para>
1712717127
<para>
17128-
Returns the result of a JSON path predicate check for the specified
17129-
JSON value.
17128+
Returns the SQL boolean result of a JSON path predicate check
17129+
for the specified JSON value.
1713017130
(This is useful only
1713117131
with <link linkend="functions-sqljson-check-expressions">predicate
1713217132
check expressions</link>, not SQL-standard JSON path expressions,
@@ -17593,9 +17593,9 @@ SELECT '{
1759317593
Boolean predicate, whereas the SQL standard allows predicates only within
1759417594
filters. While SQL-standard path expressions return the relevant
1759517595
element(s) of the queried JSON value, predicate check expressions
17596-
return the single three-valued result of the
17596+
return the single three-valued <type>jsonb</type> result of the
1759717597
predicate: <literal>true</literal>,
17598-
<literal>false</literal>, or <literal>unknown</literal>.
17598+
<literal>false</literal>, or <literal>null</literal>.
1759917599
For example, we could write this SQL-standard filter expression:
1760017600
<screen>
1760117601
<prompt>=&gt;</prompt> <userinput>select jsonb_path_query(:'json', '$.track.segments ?(@[*].HR &gt; 130)');</userinput>

0 commit comments

Comments
 (0)