SQL/JSON: Update example in JSON_QUERY() documentation
authorAmit Langote <[email protected]>
Fri, 13 Sep 2024 07:07:42 +0000 (16:07 +0900)
committerAmit Langote <[email protected]>
Fri, 13 Sep 2024 07:10:14 +0000 (16:10 +0900)
Commit e6c45d85dc fixed the behavior of JSON_QUERY() when WITH
CONDITIONAL WRAPPER is used, but the documentation example wasn't
updated to reflect this change. This commit updates the example to
show the correct result.

Per off-list report from Andreas Ulbrich.

Backpatch-through: 17

doc/src/sgml/func.sgml

index d36e4979b677c7e2ecbebd803ffe65d0dbe01f7d..84eb3a45eeac6add77cf635991478842ec2f77a2 100644 (file)
@@ -18883,7 +18883,7 @@ ERROR:  jsonpath array subscript is out of bounds
        </para>
        <para>
         <literal>JSON_QUERY(jsonb '[1,[2,3],null]', 'lax $[*][$off]' PASSING 1 AS off WITH CONDITIONAL WRAPPER)</literal>
-        <returnvalue>[3]</returnvalue>
+        <returnvalue>3</returnvalue>
        </para>
        <para>
         <literal>JSON_QUERY(jsonb '{"a": "[1, 2]"}', 'lax $.a' OMIT QUOTES)</literal>