Skip to content

Commit 7861fc2

Browse files
authored
Extend agtype containment operators (@>, <@) (#1285) (#1421)
This PR is part of the patch originally authored by Josh Innis for issue # 282. The work included in this PR is as follows: - Enable the usage of left and right containment operators inside the cypher queries - Extend this operator to be used with scalars - Add relevant regression tests
1 parent 5be3c14 commit 7861fc2

File tree

10 files changed

+824
-47
lines changed

10 files changed

+824
-47
lines changed

age--1.4.0.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -3136,7 +3136,8 @@ PARALLEL SAFE;
31363136

31373137
CREATE OPERATOR CLASS ag_catalog.gin_agtype_ops
31383138
DEFAULT FOR TYPE agtype USING gin AS
3139-
OPERATOR 7 @>,
3139+
OPERATOR 7 @>(agtype, agtype),
3140+
OPERATOR 8 <@(agtype, agtype),
31403141
OPERATOR 9 ?(agtype, agtype),
31413142
OPERATOR 10 ?|(agtype, agtype),
31423143
OPERATOR 11 ?&(agtype, agtype),

regress/expected/agtype.out

-24
Original file line numberDiff line numberDiff line change
@@ -3057,30 +3057,6 @@ SELECT age_end_id(agtype_in('null'));
30573057

30583058
(1 row)
30593059

3060-
SELECT agtype_contains('{"id": 1}','{"id": 1}');
3061-
agtype_contains
3062-
-----------------
3063-
t
3064-
(1 row)
3065-
3066-
SELECT agtype_contains('{"id": 1}','{"id": 2}');
3067-
agtype_contains
3068-
-----------------
3069-
f
3070-
(1 row)
3071-
3072-
SELECT '{"id": 1}'::agtype @> '{"id": 1}';
3073-
?column?
3074-
----------
3075-
t
3076-
(1 row)
3077-
3078-
SELECT '{"id": 1}'::agtype @> '{"id": 2}';
3079-
?column?
3080-
----------
3081-
f
3082-
(1 row)
3083-
30843060
--
30853061
-- Test STARTS WITH, ENDS WITH, and CONTAINS
30863062
--

0 commit comments

Comments
 (0)