Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 52 additions & 3 deletions age--1.4.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2981,6 +2981,23 @@ CREATE OPERATOR ? (
JOIN = contjoinsel
);

CREATE FUNCTION ag_catalog.agtype_exists_agtype(agtype, agtype)
RETURNS boolean
LANGUAGE c
IMMUTABLE
RETURNS NULL ON NULL INPUT
PARALLEL SAFE
AS 'MODULE_PATHNAME';

CREATE OPERATOR ? (
LEFTARG = agtype,
RIGHTARG = agtype,
FUNCTION = ag_catalog.agtype_exists_agtype,
COMMUTATOR = '?',
RESTRICT = contsel,
JOIN = contjoinsel
);

CREATE FUNCTION ag_catalog.agtype_exists_any(agtype, text[])
RETURNS boolean
LANGUAGE c
Expand All @@ -2997,6 +3014,22 @@ CREATE OPERATOR ?| (
JOIN = contjoinsel
);

CREATE FUNCTION ag_catalog.agtype_exists_any_agtype(agtype, agtype)
RETURNS boolean
LANGUAGE c
IMMUTABLE
RETURNS NULL ON NULL INPUT
PARALLEL SAFE
AS 'MODULE_PATHNAME';

CREATE OPERATOR ?| (
LEFTARG = agtype,
RIGHTARG = agtype,
FUNCTION = ag_catalog.agtype_exists_any_agtype,
RESTRICT = contsel,
JOIN = contjoinsel
);

CREATE FUNCTION ag_catalog.agtype_exists_all(agtype, text[])
RETURNS boolean
LANGUAGE c
Expand All @@ -3013,6 +3046,22 @@ CREATE OPERATOR ?& (
JOIN = contjoinsel
);

CREATE FUNCTION ag_catalog.agtype_exists_all_agtype(agtype, agtype)
RETURNS boolean
LANGUAGE c
IMMUTABLE
RETURNS NULL ON NULL INPUT
PARALLEL SAFE
AS 'MODULE_PATHNAME';

CREATE OPERATOR ?& (
LEFTARG = agtype,
RIGHTARG = agtype,
FUNCTION = ag_catalog.agtype_exists_all_agtype,
RESTRICT = contsel,
JOIN = contjoinsel
);

--
-- agtype GIN support
--
Expand Down Expand Up @@ -3062,9 +3111,9 @@ PARALLEL SAFE;
CREATE OPERATOR CLASS ag_catalog.gin_agtype_ops
DEFAULT FOR TYPE agtype USING gin AS
OPERATOR 7 @>,
OPERATOR 9 ?(agtype, text),
OPERATOR 10 ?|(agtype, text[]),
OPERATOR 11 ?&(agtype, text[]),
OPERATOR 9 ?(agtype, agtype),
OPERATOR 10 ?|(agtype, agtype),
OPERATOR 11 ?&(agtype, agtype),
FUNCTION 1 ag_catalog.gin_compare_agtype(text,text),
FUNCTION 2 ag_catalog.gin_extract_agtype(agtype, internal),
FUNCTION 3 ag_catalog.gin_extract_agtype_query(agtype, internal, int2,
Expand Down
72 changes: 0 additions & 72 deletions regress/expected/agtype.out
Original file line number Diff line number Diff line change
Expand Up @@ -2762,78 +2762,6 @@ SELECT '{"id": 1}'::agtype @> '{"id": 2}';
f
(1 row)

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

SELECT agtype_exists('{"id": 1}','not_id');
agtype_exists
---------------
f
(1 row)

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

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

SELECT agtype_exists_any('{"id": 1}', array['id']);
agtype_exists_any
-------------------
t
(1 row)

SELECT agtype_exists_any('{"id": 1}', array['not_id']);
agtype_exists_any
-------------------
f
(1 row)

SELECT '{"id": 1}'::agtype ?| array['id'];
?column?
----------
t
(1 row)

SELECT '{"id": 1}'::agtype ?| array['not_id'];
?column?
----------
f
(1 row)

SELECT agtype_exists_all('{"id": 1}', array['id']);
agtype_exists_all
-------------------
t
(1 row)

SELECT agtype_exists_all('{"id": 1}', array['not_id']);
agtype_exists_all
-------------------
f
(1 row)

SELECT '{"id": 1}'::agtype ?& array['id'];
?column?
----------
t
(1 row)

SELECT '{"id": 1}'::agtype ?& array['not_id'];
?column?
----------
f
(1 row)

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