Skip to content

Commit

Permalink
Extend agtype containment operators (@>, <@) (#1285) (#1419)
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 authored Nov 28, 2023
1 parent 2d9e370 commit 8e779bb
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 @@ -3142,7 +3142,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 @@ -3058,30 +3058,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 8e779bb

Please sign in to comment.