[postgis-tickets] [PostGIS] #3633: PostGIS upgrade is broken - operator does not exist: gidx public.&& geography

PostGIS trac at osgeo.org
Sun Sep 18 02:06:47 PDT 2016


#3633: PostGIS upgrade is broken - operator does not exist: gidx public.&&
geography
----------------------+---------------------------
  Reporter:  komzpa   |      Owner:  robe
      Type:  defect   |     Status:  closed
  Priority:  low      |  Milestone:  PostGIS 2.3.0
 Component:  postgis  |    Version:  2.2.x
Resolution:  wontfix  |   Keywords:
----------------------+---------------------------
Changes (by robe):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 komzpa,

 I ran into this myself. I'm guessing you were trying to upgrade from an
 earlier 2.3.0.
 So this would be a non-issue for production upgrades.


 The reason you are getting this is because of the BRIN introduction, and
 our upgrade logic can't handle index binding changes within a micro
 update.  So since you are going from a 2.3.0 before brin was introduced to
 2.3.0 after brin, you are having this issue.

 As I recall when testing upgrading from a 2.2 to 2.3.0 this was a non-
 issue.


 To fix, as I recall, I had to take out the

 IF 203 > ... wrapper around the BRIN stuff so that the brin operators and
 families could be created.


 {{{
 -- Operator family brin_geography_inclusion_ops brin -- LastUpdated: 203
 DO LANGUAGE 'plpgsql'
 $postgis_proc_upgrade$
 BEGIN
   IF 203 > version_from_num FROM _postgis_upgrade_info THEN
     EXECUTE $postgis_proc_upgrade_parsed_def$ CREATE OPERATOR FAMILY
 brin_geography_inclusion_ops USING brin;

 -- Availability: 2.3.0
 CREATE OR REPLACE FUNCTION geog_brin_inclusion_add_value(internal,
 internal, internal, internal) RETURNS boolean
         AS '$libdir/postgis-2.3','geog_brin_inclusion_add_value'
         LANGUAGE 'c';

 -- Availability: 2.3.0
 CREATE OPERATOR CLASS brin_geography_inclusion_ops
   DEFAULT FOR TYPE geography
   USING brin
   FAMILY brin_geography_inclusion_ops AS
     OPERATOR      3        &&(geography, geography),
     FUNCTION      1        brin_inclusion_opcinfo(internal) ,
     FUNCTION      2        geog_brin_inclusion_add_value(internal,
 internal, internal, internal) ,
     FUNCTION      3        brin_inclusion_consistent(internal, internal,
 internal) ,
     FUNCTION      4        brin_inclusion_union(internal, internal,
 internal) ,
   STORAGE gidx;

 ALTER OPERATOR FAMILY brin_geography_inclusion_ops USING brin ADD
     OPERATOR      3         &&(gidx, geography),

     OPERATOR      3         &&(geography, gidx),

     OPERATOR      3         &&(gidx, gidx);
  $postgis_proc_upgrade_parsed_def$;
   END IF;
 END
 $postgis_proc_upgrade$;
 }}}

 I think strk has a ticket in place already for this kind of thing (to make
 dev upgrades possible even in these cases) though I can't find it at
 moment

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3633#comment:4>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list