diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/jsonpath.out /tmp/cirrus-ci-build/src/bin/pg_upgrade/tmp_check/results/jsonpath.out --- /tmp/cirrus-ci-build/src/test/regress/expected/jsonpath.out 2025-05-27 02:13:13.734173322 +0000 +++ /tmp/cirrus-ci-build/src/bin/pg_upgrade/tmp_check/results/jsonpath.out 2025-05-27 02:18:53.653706637 +0000 @@ -160,11 +160,9 @@ (1 row) select '1 * 2 + 4 % -3 != false'::jsonpath; - jsonpath ---------------------------- - (1 * 2 + 4 % -3 != false) -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: select '1 * 2 + 4 % -3 != false'::jsonpath; + ^ select '"\b\f\r\n\t\v\"\''\\"'::jsonpath; jsonpath ------------------------- @@ -244,11 +242,9 @@ (1 row) select '$.g ? ((@.x >= 123 || @.a == 4) is unknown)'::jsonpath; - jsonpath -------------------------------------------------- - $."g"?((@."x" >= 123 || @."a" == 4) is unknown) -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: select '$.g ? ((@.x >= 123 || @.a == 4) is unknown)'::jsonpa... + ^ select '$.g ? (exists (@.x))'::jsonpath; jsonpath ------------------------ @@ -382,11 +378,9 @@ (1 row) select '$.double().floor().ceiling().abs()'::jsonpath; - jsonpath ------------------------------------- - $.double().floor().ceiling().abs() -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select '$.double().floor().ceiling().abs()'::jsonpath; + ^ select '$.keyvalue().key'::jsonpath; jsonpath -------------------- @@ -436,11 +430,9 @@ (1 row) select '$.replace("hello","bye")'::jsonpath; - jsonpath --------------------------- - $.replace("hello","bye") -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select '$.replace("hello","bye")'::jsonpath; + ^ select '$.lower()'::jsonpath; jsonpath ----------- @@ -454,11 +446,9 @@ (1 row) select '$.lower().upper().lower().replace("hello","bye")'::jsonpath; - jsonpath --------------------------------------------------- - $.lower().upper().lower().replace("hello","bye") -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select '$.lower().upper().lower().replace("hello","bye")'::j... + ^ select '$.ltrim()'::jsonpath; jsonpath ----------- @@ -496,11 +486,9 @@ (1 row) select '$.initcap()'::jsonpath; - jsonpath -------------- - $.initcap() -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select '$.initcap()'::jsonpath; + ^ select '$.split_part("~@~", 2)'::jsonpath; jsonpath ----------------------- diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/jsonb_jsonpath.out /tmp/cirrus-ci-build/src/bin/pg_upgrade/tmp_check/results/jsonb_jsonpath.out --- /tmp/cirrus-ci-build/src/test/regress/expected/jsonb_jsonpath.out 2025-05-27 02:13:13.734173322 +0000 +++ /tmp/cirrus-ci-build/src/bin/pg_upgrade/tmp_check/results/jsonb_jsonpath.out 2025-05-27 02:18:54.077710895 +0000 @@ -208,17 +208,13 @@ (1 row) select jsonb '1' @? '$ ? ((@ == "1") is unknown)'; - ?column? ----------- - t -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: select jsonb '1' @? '$ ? ((@ == "1") is unknown)'; + ^ select jsonb '1' @? '$ ? ((@ == 1) is unknown)'; - ?column? ----------- - f -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: select jsonb '1' @? '$ ? ((@ == 1) is unknown)'; + ^ select jsonb '[{"a": 1}, {"a": 2}]' @? '$[0 to 1] ? (@.a > 1)'; ?column? ---------- @@ -814,12 +810,9 @@ (0 rows) select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? ((exists (@.x + "3")) is unknown)'); - jsonb_path_query ------------------- - {"x": 2} - {"y": 3} -(2 rows) - +ERROR: syntax error at end of jsonpath input +LINE 1: ...t jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ?... + ^ select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g[*] ? (exists (@.x))'); jsonb_path_query ------------------ @@ -827,22 +820,18 @@ (1 row) select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g[*] ? ((exists (@.x)) is unknown)'); - jsonb_path_query ------------------- - {"y": 3} -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: ...t jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.... + ^ select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g ? (exists (@[*].x))'); jsonb_path_query ------------------ (0 rows) select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g ? ((exists (@[*].x)) is unknown)'); - jsonb_path_query ----------------------- - [{"x": 2}, {"y": 3}] -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: ...t jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.... + ^ --test ternary logic select x, y, @@ -856,19 +845,9 @@ from (values (jsonb 'true'), ('false'), ('"null"')) x(x), (values (jsonb 'true'), ('false'), ('"null"')) y(y); - x | y | x && y ---------+--------+-------- - true | true | true - true | false | false - true | "null" | null - false | true | false - false | false | false - false | "null" | false - "null" | true | null - "null" | false | false - "null" | "null" | null -(9 rows) - +ERROR: syntax error at or near " " of jsonpath input +LINE 5: '$[*] ? (@ == true && ($x == true && $y == true) || + ^ select x, y, jsonb_path_query( @@ -881,19 +860,9 @@ from (values (jsonb 'true'), ('false'), ('"null"')) x(x), (values (jsonb 'true'), ('false'), ('"null"')) y(y); - x | y | x || y ---------+--------+-------- - true | true | true - true | false | true - true | "null" | true - false | true | true - false | false | false - false | "null" | null - "null" | true | true - "null" | false | null - "null" | "null" | null -(9 rows) - +ERROR: syntax error at or near " " of jsonpath input +LINE 5: '$[*] ? (@ == true && ($x == true || $y == true) || + ^ select jsonb '{"a": 1, "b":1}' @? '$ ? (@.a == @.b)'; ?column? ---------- @@ -1042,11 +1011,9 @@ (3 rows) select jsonb_path_query('[1,2,0,3]', '$[*] ? ((2 / @ > 0) is unknown)'); - jsonb_path_query ------------------- - 0 -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: select jsonb_path_query('[1,2,0,3]', '$[*] ? ((2 / @ > 0) is... + ^ select jsonb_path_query('0', '1 / $'); ERROR: division by zero select jsonb_path_query('0', '1 / $ + 2'); @@ -1348,11 +1315,9 @@ (1 row) select jsonb_path_query('{"a": 2.5}', '-($.a * $.a).floor() % 4.3'); - jsonb_path_query ------------------- - -1.7 -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('{"a": 2.5}', '-($.a * $.a).floor() ... + ^ select jsonb_path_query('[1, 2, 3]', '($[*] > 2) ? (@ == true)'); jsonb_path_query ------------------ @@ -1409,15 +1374,9 @@ (5 rows) select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].floor()'); - jsonb_path_query ------------------- - 0 - 1 - -2 - -4 - 5 -(5 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].floor... + ^ select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling()'); jsonb_path_query ------------------ @@ -1570,7 +1529,9 @@ select jsonb_path_query('{}', '$.abs()'); ERROR: jsonpath item method .abs() can only be applied to a numeric value select jsonb_path_query('true', '$.floor()'); -ERROR: jsonpath item method .floor() can only be applied to a numeric value +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('true', '$.floor()'); + ^ select jsonb_path_query('"1.2"', '$.ceiling()'); ERROR: jsonpath item method .ceiling() can only be applied to a numeric value select jsonb_path_query('{}', '$.abs()', silent => true); @@ -1579,10 +1540,9 @@ (0 rows) select jsonb_path_query('true', '$.floor()', silent => true); - jsonb_path_query ------------------- -(0 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('true', '$.floor()', silent => true)... + ^ select jsonb_path_query('"1.2"', '$.ceiling()', silent => true); jsonb_path_query ------------------ @@ -1612,11 +1572,9 @@ (0 rows) select jsonb_path_query('["abc", "abcabc", null, 1]', 'strict $ ? ((@[*] starts with "abc") is unknown)'); - jsonb_path_query ----------------------------- - ["abc", "abcabc", null, 1] -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: ...ct jsonb_path_query('["abc", "abcabc", null, 1]', 'strict $ ... + ^ select jsonb_path_query('[[null, 1, "abc", "abcabc"]]', 'lax $ ? (@[*] starts with "abc")'); jsonb_path_query ---------------------------- @@ -1624,18 +1582,13 @@ (1 row) select jsonb_path_query('[[null, 1, "abd", "abdabc"]]', 'lax $ ? ((@[*] starts with "abc") is unknown)'); - jsonb_path_query ----------------------------- - [null, 1, "abd", "abdabc"] -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: ... jsonb_path_query('[[null, 1, "abd", "abdabc"]]', 'lax $ ? (... + ^ select jsonb_path_query('[null, 1, "abd", "abdabc"]', 'lax $[*] ? ((@ starts with "abc") is unknown)'); - jsonb_path_query ------------------- - null - 1 -(2 rows) - +ERROR: syntax error at end of jsonpath input +LINE 1: ...ct jsonb_path_query('[null, 1, "abd", "abdabc"]', 'lax $[*] ... + ^ select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c")'); jsonb_path_query ------------------ @@ -2982,102 +2935,102 @@ -- test .initcap() select jsonb_path_query('null', '$.initcap()'); -ERROR: jsonpath item method .initcap() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('null', '$.initcap()'); + ^ select jsonb_path_query('null', '$.initcap()', silent => true); - jsonb_path_query ------------------- -(0 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('null', '$.initcap()', silent => tru... + ^ select jsonb_path_query('[]', '$.initcap()'); - jsonb_path_query ------------------- -(0 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('[]', '$.initcap()'); + ^ select jsonb_path_query('[]', 'strict $.initcap()'); -ERROR: jsonpath item method .initcap() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('[]', 'strict $.initcap()'); + ^ select jsonb_path_query('{}', '$.initcap()'); -ERROR: jsonpath item method .initcap() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('{}', '$.initcap()'); + ^ select jsonb_path_query('[]', 'strict $.initcap()', silent => true); - jsonb_path_query ------------------- -(0 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('[]', 'strict $.initcap()', silent =... + ^ select jsonb_path_query('{}', '$.initcap()', silent => true); - jsonb_path_query ------------------- -(0 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('{}', '$.initcap()', silent => true)... + ^ select jsonb_path_query('1.23', '$.initcap()'); -ERROR: jsonpath item method .initcap() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('1.23', '$.initcap()'); + ^ select jsonb_path_query('"1.23"', '$.initcap()'); - jsonb_path_query ------------------- - "1.23" -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('"1.23"', '$.initcap()'); + ^ select jsonb_path_query('"1.23aaa"', '$.initcap()'); - jsonb_path_query ------------------- - "1.23aaa" -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('"1.23aaa"', '$.initcap()'); + ^ select jsonb_path_query('1234', '$.initcap()'); -ERROR: jsonpath item method .initcap() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('1234', '$.initcap()'); + ^ select jsonb_path_query('true', '$.initcap()'); -ERROR: jsonpath item method .initcap() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('true', '$.initcap()'); + ^ select jsonb_path_query('1234', '$.initcap().type()'); -ERROR: jsonpath item method .initcap() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('1234', '$.initcap().type()'); + ^ select jsonb_path_query('[2, true]', '$.initcap()'); -ERROR: jsonpath item method .initcap() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('[2, true]', '$.initcap()'); + ^ select jsonb_path_query('["maybe yes", "probably no"]', '$.initcap()'); - jsonb_path_query ------------------- - "Maybe Yes" - "Probably No" -(2 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: ... jsonb_path_query('["maybe yes", "probably no"]', '$.initcap... + ^ -- Test .replace() select jsonb_path_query('null', '$.replace("x", "bye")'); -ERROR: jsonpath item method .replace() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('null', '$.replace("x", "bye")'); + ^ select jsonb_path_query('null', '$.replace("x", "bye")', silent => true); - jsonb_path_query ------------------- -(0 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('null', '$.replace("x", "bye")', sil... + ^ select jsonb_path_query('["x", "y", "z"]', '$.replace("x", "bye")'); - jsonb_path_query ------------------- - "bye" - "y" - "z" -(3 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('["x", "y", "z"]', '$.replace("x", "... + ^ select jsonb_path_query('{}', '$.replace("x", "bye")'); -ERROR: jsonpath item method .replace() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('{}', '$.replace("x", "bye")'); + ^ select jsonb_path_query('[]', 'strict $.replace("x", "bye")', silent => true); - jsonb_path_query ------------------- -(0 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('[]', 'strict $.replace("x", "bye")'... + ^ select jsonb_path_query('{}', '$.replace("x", "bye")', silent => true); - jsonb_path_query ------------------- -(0 rows) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('{}', '$.replace("x", "bye")', silen... + ^ select jsonb_path_query('1.23', '$.replace("x", "bye")'); -ERROR: jsonpath item method .replace() can only be applied to a string +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('1.23', '$.replace("x", "bye")'); + ^ select jsonb_path_query('"hello world"', '$.replace("hello","bye")'); - jsonb_path_query ------------------- - "bye world" -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('"hello world"', '$.replace("hello",... + ^ select jsonb_path_query('"hello world"', '$.replace("hello","bye") starts with "bye"'); - jsonb_path_query ------------------- - true -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('"hello world"', '$.replace("hello",... + ^ -- Test .split_part() select jsonb_path_query('"abc~@~def~@~ghi"', '$.split_part("~@~", 2)'); jsonb_path_query @@ -3087,35 +3040,25 @@ -- Test string methods play nicely together select jsonb_path_query('"hello world"', '$.replace("hello","bye").upper()'); - jsonb_path_query ------------------- - "BYE WORLD" -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('"hello world"', '$.replace("hello",... + ^ select jsonb_path_query('"hElLo WorlD"', '$.lower().upper().lower().replace("hello","bye")'); - jsonb_path_query ------------------- - "bye world" -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('"hElLo WorlD"', '$.lower().upper().... + ^ select jsonb_path_query('"hElLo WorlD"', '$.upper().lower().upper().replace("HELLO", "BYE")'); - jsonb_path_query ------------------- - "BYE WORLD" -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('"hElLo WorlD"', '$.upper().lower().... + ^ select jsonb_path_query('"hElLo WorlD"', '$.lower().upper().lower().replace("hello","bye") starts with "bye"'); - jsonb_path_query ------------------- - true -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('"hElLo WorlD"', '$.lower().upper().... + ^ select jsonb_path_query('" hElLo WorlD "', '$.btrim().lower().upper().lower().replace("hello","bye") starts with "bye"'); - jsonb_path_query ------------------- - true -(1 row) - +ERROR: syntax error at or near "(" of jsonpath input +LINE 1: select jsonb_path_query('" hElLo WorlD "', '$.btrim().lowe... + ^ -- Test .time() select jsonb_path_query('null', '$.time()'); ERROR: jsonpath item method .time() can only be applied to a string @@ -4549,11 +4492,9 @@ SELECT jsonb_path_query('[{"a": 1}]', '$undefined_var'); ERROR: could not find jsonpath variable "undefined_var" SELECT jsonb_path_query('[{"a": 1}]', 'false'); - jsonb_path_query ------------------- - false -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: SELECT jsonb_path_query('[{"a": 1}]', 'false'); + ^ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a'); ERROR: JSON object does not contain key "a" SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a'); @@ -4627,11 +4568,9 @@ SELECT jsonb_path_query_first('[{"a": 1}]', '$undefined_var'); ERROR: could not find jsonpath variable "undefined_var" SELECT jsonb_path_query_first('[{"a": 1}]', 'false'); - jsonb_path_query_first ------------------------- - false -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: SELECT jsonb_path_query_first('[{"a": 1}]', 'false'); + ^ SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*].a ? (@ > 1)'; ?column? ---------- @@ -4665,11 +4604,9 @@ SELECT jsonb_path_exists('[{"a": 1}]', '$undefined_var'); ERROR: could not find jsonpath variable "undefined_var" SELECT jsonb_path_exists('[{"a": 1}]', 'false'); - jsonb_path_exists -------------------- - t -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: SELECT jsonb_path_exists('[{"a": 1}]', 'false'); + ^ SELECT jsonb_path_match('true', '$', silent => false); jsonb_path_match ------------------ @@ -4735,11 +4672,9 @@ SELECT jsonb_path_match('[{"a": 1}]', '$undefined_var'); ERROR: could not find jsonpath variable "undefined_var" SELECT jsonb_path_match('[{"a": 1}]', 'false'); - jsonb_path_match ------------------- - f -(1 row) - +ERROR: syntax error at end of jsonpath input +LINE 1: SELECT jsonb_path_match('[{"a": 1}]', 'false'); + ^ -- test string comparison (Unicode codepoint collation) WITH str(j, num) AS (