Skip to content

Commit cb0600b

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 cb0600b

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
@@ -3170,7 +3170,8 @@ 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),
3174+
OPERATOR 8 <@(agtype, agtype),
31743175
OPERATOR 9 ?(agtype, agtype),
31753176
OPERATOR 10 ?|(agtype, agtype),
31763177
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)