aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/sql/jsonb_jsonpath.sql
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2019-03-20 10:27:56 +0300
committerAlexander Korotkov <akorotkov@postgresql.org>2019-03-20 10:30:56 +0300
commit641fde25233ef3ecc3b8101fe287eea9fceba6fd (patch)
tree0636c079566c00b202858caf44fc921471b95595 /src/test/regress/sql/jsonb_jsonpath.sql
parent1f39a1c0641531e0462a4822f2dba904c5d4d699 (diff)
downloadpostgresql-641fde25233ef3ecc3b8101fe287eea9fceba6fd.tar.gz
postgresql-641fde25233ef3ecc3b8101fe287eea9fceba6fd.zip
Remove ambiguity for jsonb_path_match() and jsonb_path_exists()
There are 2-arguments and 4-arguments versions of jsonb_path_match() and jsonb_path_exists(). But 4-arguments versions have optional 3rd and 4th arguments, that leads to ambiguity. In the same time 2-arguments versions are needed only for @@ and @? operators. So, rename 2-arguments versions to remove the ambiguity. Catversion is bumped.
Diffstat (limited to 'src/test/regress/sql/jsonb_jsonpath.sql')
-rw-r--r--src/test/regress/sql/jsonb_jsonpath.sql2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/regress/sql/jsonb_jsonpath.sql b/src/test/regress/sql/jsonb_jsonpath.sql
index b56f8872ae8..41b346b2d4d 100644
--- a/src/test/regress/sql/jsonb_jsonpath.sql
+++ b/src/test/regress/sql/jsonb_jsonpath.sql
@@ -362,8 +362,10 @@ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].
SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*].a ? (@ > 1)';
SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*] ? (@.a > 2)';
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 1)');
SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 1, "max": 4}');
SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 3, "max": 4}');
SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 1';
SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 2';
+SELECT jsonb_path_match('[{"a": 1}, {"a": 2}]', '$[*].a > 1');