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

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


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

commit bcc9e27aa42d385ae88a9a66ea3f55a2d7e8b706
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 d04a6a24..5c33bec7 100644
--- a/age--1.5.0--y.y.y.sql
+++ b/age--1.5.0--y.y.y.sql
@@ -75,13 +75,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,
@@ -131,30 +136,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,
@@ -166,6 +164,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
@@ -186,9 +185,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