From: Bruce Momjian Date: Wed, 20 Nov 2024 22:03:45 +0000 (-0500) Subject: doc: clarify that jsonb_path_match() returns an SQL boolean X-Git-Tag: REL_18_BETA1~1456 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=70236cf22f4c42338d25c07f7fd00bd5c5830eb5;p=postgresql.git 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 --- diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 72f223a0414..13ccbe7d78c 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -17178,8 +17178,8 @@ ERROR: value too long for type character(2) boolean - 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 predicate check expressions, 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 jsonb result of the predicate: true, - false, or unknown. + false, or null. For example, we could write this SQL-standard filter expression: => select jsonb_path_query(:'json', '$.track.segments ?(@[*].HR > 130)');