Skip to content

Commit

Permalink
Extend agtype containment operators (@>, <@)
Browse files Browse the repository at this point in the history
 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
  • Loading branch information
Zainab-Saad committed Oct 19, 2023
1 parent 7a42fb5 commit cb0600b
Show file tree
Hide file tree
Showing 10 changed files with 824 additions and 47 deletions.
3 changes: 2 additions & 1 deletion age--1.4.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3170,7 +3170,8 @@ PARALLEL SAFE;

CREATE OPERATOR CLASS ag_catalog.gin_agtype_ops
DEFAULT FOR TYPE agtype USING gin AS
OPERATOR 7 @>,
OPERATOR 7 @>(agtype, agtype),
OPERATOR 8 <@(agtype, agtype),
OPERATOR 9 ?(agtype, agtype),
OPERATOR 10 ?|(agtype, agtype),
OPERATOR 11 ?&(agtype, agtype),
Expand Down
24 changes: 0 additions & 24 deletions regress/expected/agtype.out
Original file line number Diff line number Diff line change
Expand Up @@ -3205,30 +3205,6 @@ SELECT age_end_id(agtype_in('null'));

(1 row)

SELECT agtype_contains('{"id": 1}','{"id": 1}');
agtype_contains
-----------------
t
(1 row)

SELECT agtype_contains('{"id": 1}','{"id": 2}');
agtype_contains
-----------------
f
(1 row)

SELECT '{"id": 1}'::agtype @> '{"id": 1}';
?column?
----------
t
(1 row)

SELECT '{"id": 1}'::agtype @> '{"id": 2}';
?column?
----------
f
(1 row)

--
-- Test STARTS WITH, ENDS WITH, and CONTAINS
--
Expand Down
Loading

0 comments on commit cb0600b

Please sign in to comment.