This is an automated email from the ASF dual-hosted git repository.

mtaha pushed a commit to branch PG15
in repository https://gitbox.apache.org/repos/asf/age.git


The following commit(s) were added to refs/heads/PG15 by this push:
     new b51f4c3e Fix upgrade script for 1.5.0 to 1.6.0 (#2211)
b51f4c3e is described below

commit b51f4c3ef3315f9e43e8170dfe62a6e6070fac59
Author: Muhammad Taha Naveed <[email protected]>
AuthorDate: Mon Aug 25 21:22:01 2025 +0500

    Fix upgrade script for 1.5.0 to 1.6.0 (#2211)
    
    - 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--y.y.y.sql | 54 ++++++++++++++++++++++++---------------------------
 1 file changed, 25 insertions(+), 29 deletions(-)

diff --git a/age--1.5.0--y.y.y.sql b/age--1.5.0--y.y.y.sql
index cb76b398..34630175 100644
--- a/age--1.5.0--y.y.y.sql
+++ b/age--1.5.0--y.y.y.sql
@@ -94,13 +94,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,
@@ -150,30 +155,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,
@@ -185,6 +183,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
@@ -205,9 +204,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

Reply via email to