*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 201903161
+#define CATALOG_VERSION_NO 201903201
#endif
oprresult => 'jsonb', oprcode => 'jsonb_delete_path' },
{ oid => '4012', descr => 'jsonpath exists',
oprname => '@?', oprleft => 'jsonb', oprright => 'jsonpath',
- oprresult => 'bool', oprcode => 'jsonb_path_exists(jsonb,jsonpath)',
+ oprresult => 'bool', oprcode => 'jsonb_path_exists_opr(jsonb,jsonpath)',
oprrest => 'contsel', oprjoin => 'contjoinsel' },
{ oid => '4013', descr => 'jsonpath match',
oprname => '@@', oprleft => 'jsonb', oprright => 'jsonpath',
- oprresult => 'bool', oprcode => 'jsonb_path_match(jsonb,jsonpath)',
+ oprresult => 'bool', oprcode => 'jsonb_path_match_opr(jsonb,jsonpath)',
oprrest => 'contsel', oprjoin => 'contjoinsel' },
]
prosrc => 'jsonb_path_match' },
{ oid => '4010', descr => 'implementation of @? operator',
- proname => 'jsonb_path_exists', prorettype => 'bool',
+ proname => 'jsonb_path_exists_opr', prorettype => 'bool',
proargtypes => 'jsonb jsonpath', prosrc => 'jsonb_path_exists_opr' },
{ oid => '4011', descr => 'implementation of @@ operator',
- proname => 'jsonb_path_match', prorettype => 'bool',
+ proname => 'jsonb_path_match_opr', prorettype => 'bool',
proargtypes => 'jsonb jsonpath', prosrc => 'jsonb_path_match_opr' },
# txid
f
(1 row)
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 1)');
+ jsonb_path_exists
+-------------------
+ t
+(1 row)
+
SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 1, "max": 4}');
jsonb_path_exists
-------------------
f
(1 row)
+SELECT jsonb_path_match('[{"a": 1}, {"a": 2}]', '$[*].a > 1');
+ jsonb_path_match
+------------------
+ t
+(1 row)
+
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');