git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f722dd3)
doc: clarify that jsonb_path_match() returns an SQL boolean
2024年11月20日 22:03:45 +0000 (17:03 -0500)
2024年11月20日 22:03:45 +0000 (17:03 -0500)
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


diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 72f223a04145db978df4d0e3c85714f38fbea810..13ccbe7d78c26e947112586da19a1e904b487e95 100644 (file)
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -17178,8 +17178,8 @@ ERROR: value too long for type character(2)
<returnvalue>boolean</returnvalue>
</para>
<para>
- Returns the result of a JSON path predicate check for the specified
- JSON value.
+ Returns the SQL boolean result of a JSON path predicate check
+ for the specified JSON value.
(This is useful only
with <link linkend="functions-sqljson-check-expressions">predicate
check expressions</link>, not SQL-standard JSON path expressions,
@@ -17646,9 +17646,9 @@ SELECT '{
Boolean predicate, whereas the SQL standard allows predicates only within
filters. While SQL-standard path expressions return the relevant
element(s) of the queried JSON value, predicate check expressions
- return the single three-valued result of the
+ return the single three-valued <type>jsonb</type> result of the
predicate: <literal>true</literal>,
- <literal>false</literal>, or <literal>unknown</literal>.
+ <literal>false</literal>, or <literal>null</literal>.
For example, we could write this SQL-standard filter expression:
<screen>
<prompt>=&gt;</prompt> <userinput>select jsonb_path_query(:'json', '$.track.segments ?(@[*].HR &gt; 130)');</userinput>
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /