This is an automated email from the ASF dual-hosted git repository.
jgemignani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/age.git
The following commit(s) were added to refs/heads/master by this push:
new 1afd9fb3 Fix upgrade script for 1.5.0 to 1.6.0 (#2210)
1afd9fb3 is described below
commit 1afd9fb322c182aef9c79969417582590fb4dd8d
Author: Muhammad Taha Naveed <[email protected]>
AuthorDate: Tue Sep 2 22:05:33 2025 +0500
Fix upgrade script for 1.5.0 to 1.6.0 (#2210)
- Since there are modifications to agtype gin operators, users
will have to drop the gin indexes before running this script
and recreate them.
---
age--1.5.0--1.6.0.sql | 54 ++++++++++++++++++++++++---------------------------
1 file changed, 25 insertions(+), 29 deletions(-)
diff --git a/age--1.5.0--1.6.0.sql b/age--1.5.0--1.6.0.sql
index f37268c8..ede715c1 100644
--- a/age--1.5.0--1.6.0.sql
+++ b/age--1.5.0--1.6.0.sql
@@ -78,13 +78,18 @@ ALTER EXTENSION age
ALTER EXTENSION age
DROP OPERATOR ?| (agtype, text[]);
ALTER EXTENSION age
- DROP OPERATOR ?& (agtype, agtype[]);
+ DROP OPERATOR ?& (agtype, agtype);
ALTER EXTENSION age
- DROP OPERATOR ?& (agtype, text);
+ DROP OPERATOR ?& (agtype, text[]);
+ALTER EXTENSION age
+ DROP OPERATOR @> (agtype, agtype);
+ALTER EXTENSION age
+ DROP OPERATOR <@ (agtype, agtype);
DROP OPERATOR ? (agtype, agtype), ? (agtype, text),
?| (agtype, agtype), ?| (agtype, text[]),
- ?& (agtype, agtype[]), ?& (agtype, text);
+ ?& (agtype, agtype), ?& (agtype, text[]),
+ @> (agtype, agtype), <@ (agtype, agtype);
CREATE OPERATOR ? (
LEFTARG = agtype,
@@ -134,30 +139,23 @@ CREATE OPERATOR ?& (
JOIN = matchingjoinsel
);
-ALTER EXTENSION age
- ADD OPERATOR ? (agtype, agtype);
-ALTER EXTENSION age
- ADD OPERATOR ? (agtype, text);
-ALTER EXTENSION age
- ADD OPERATOR ?| (agtype, agtype);
-ALTER EXTENSION age
- ADD OPERATOR ?| (agtype, text[]);
-ALTER EXTENSION age
- ADD OPERATOR ?& (agtype, agtype[]);
-ALTER EXTENSION age
- ADD OPERATOR ?& (agtype, text);
-
-ALTER OPERATOR @> (agtype, agtype)
- SET (RESTRICT = matchingsel, JOIN = matchingjoinsel);
-
-ALTER OPERATOR @> (agtype, agtype)
- SET (RESTRICT = matchingsel, JOIN = matchingjoinsel);
-
-ALTER OPERATOR <@ (agtype, agtype)
- SET (RESTRICT = matchingsel, JOIN = matchingjoinsel);
+CREATE OPERATOR @> (
+ LEFTARG = agtype,
+ RIGHTARG = agtype,
+ FUNCTION = ag_catalog.agtype_contains,
+ COMMUTATOR = '<@',
+ RESTRICT = matchingsel,
+ JOIN = matchingjoinsel
+);
-ALTER OPERATOR <@ (agtype, agtype)
- SET (RESTRICT = matchingsel, JOIN = matchingjoinsel);
+CREATE OPERATOR <@ (
+ LEFTARG = agtype,
+ RIGHTARG = agtype,
+ FUNCTION = ag_catalog.agtype_contained_by,
+ COMMUTATOR = '@>',
+ RESTRICT = matchingsel,
+ JOIN = matchingjoinsel
+);
/*
* Since there is no option to add or drop operator from class,
@@ -169,6 +167,7 @@ ALTER EXTENSION age
DROP OPERATOR CLASS ag_catalog.gin_agtype_ops USING gin;
DROP OPERATOR CLASS ag_catalog.gin_agtype_ops USING gin;
+DROP OPERATOR FAMILY ag_catalog.gin_agtype_ops USING gin;
CREATE OPERATOR CLASS ag_catalog.gin_agtype_ops
DEFAULT FOR TYPE agtype USING gin AS
@@ -189,9 +188,6 @@ DEFAULT FOR TYPE agtype USING gin AS
internal, internal, internal),
STORAGE text;
-ALTER EXTENSION age
- ADD OPERATOR CLASS ag_catalog.gin_agtype_ops USING gin;
-
-- this function went from variadic "any" to just "any" type
CREATE OR REPLACE FUNCTION ag_catalog.age_tostring("any")
RETURNS agtype