Skip to content

Commit 85a5618

Browse files
committed
Extend agtype containment operators (@>, <@)
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 7a42fb5 commit 85a5618

File tree

10 files changed

+823
-47
lines changed

10 files changed

+823
-47
lines changed

age--1.4.0.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -3170,7 +3170,7 @@ PARALLEL SAFE;
31703170

31713171
CREATE OPERATOR CLASS ag_catalog.gin_agtype_ops
31723172
DEFAULT FOR TYPE agtype USING gin AS
3173-
OPERATOR 7 @>,
3173+
OPERATOR 7 @>(agtype, agtype),
31743174
OPERATOR 9 ?(agtype, agtype),
31753175
OPERATOR 10 ?|(agtype, agtype),
31763176
OPERATOR 11 ?&(agtype, agtype),

regress/expected/agtype.out

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

32063206
(1 row)
32073207

3208-
SELECT agtype_contains('{"id": 1}','{"id": 1}');
3209-
agtype_contains
3210-
-----------------
3211-
t
3212-
(1 row)
3213-
3214-
SELECT agtype_contains('{"id": 1}','{"id": 2}');
3215-
agtype_contains
3216-
-----------------
3217-
f
3218-
(1 row)
3219-
3220-
SELECT '{"id": 1}'::agtype @> '{"id": 1}';
3221-
?column?
3222-
----------
3223-
t
3224-
(1 row)
3225-
3226-
SELECT '{"id": 1}'::agtype @> '{"id": 2}';
3227-
?column?
3228-
----------
3229-
f
3230-
(1 row)
3231-
32323208
--
32333209
-- Test STARTS WITH, ENDS WITH, and CONTAINS
32343210
--

0 commit comments

Comments
 (0)