[postgis-tickets] [PostGIS] #2560: view xxx depends on function st_union(geometry)

PostGIS trac at osgeo.org
Fri Feb 21 07:56:10 PST 2014


#2560: view xxx depends on function st_union(geometry)
-----------------------------------+----------------------------------------
 Reporter:  strk                   |       Owner:  strk         
     Type:  defect                 |      Status:  new          
 Priority:  medium                 |   Milestone:  PostGIS 2.1.2
Component:  build/upgrade/install  |     Version:  2.1.x        
 Keywords:                         |  
-----------------------------------+----------------------------------------

Comment(by strk):

 I'd tried this fix:
 {{{
 diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl
 index 93b82ff..d63d236 100755
 --- a/utils/postgis_proc_upgrade.pl
 +++ b/utils/postgis_proc_upgrade.pl
 @@ -227,8 +227,17 @@ while(<INPUT>)
                         $aggtype = $1 if ( /basetype\s*=\s*([^,]*)\s*,/i
 );
                         last if /\);/;
                 }
 -               print "DROP AGGREGATE IF EXISTS $aggname($aggtype);\n";
 -               print $def;
 +    my $aggsig = "$aggname($aggtype)";
 +               my $ver = $version_from_num + 1;
 +               while( $version_from_num < $version_to_num && $ver <=
 $version_to_num )
 +               {
 +                       if( $objs->{$ver}->{"aggregates"}->{$aggsig} )
 +                       {
 +        print "DROP AGGREGATE IF EXISTS $aggsig;\n";
 +        print $def;
 +                       }
 +                       $ver++;
 +               }
         }

         # This code handles operators by creating them if we are doing a
 major upgrade
 }}}

 But the *drop* scripts are still getting in the middle, forcing drop of
 some of the aggregates,
 and not all of them have a comment telling me when the drop was required:
 {{{
 DROP AGGREGATE IF EXISTS memgeomunion(geometry);
 DROP AGGREGATE IF EXISTS geomunion(geometry);
 DROP AGGREGATE IF EXISTS polygonize(geometry); -- Deprecated in 1.2.3,
 Dropped in 2.0.0
 DROP AGGREGATE IF EXISTS collect(geometry); -- Deprecated in 1.2.3,
 Dropped in 2.0.0
 DROP AGGREGATE IF EXISTS st_geomunion(geometry);
 DROP AGGREGATE IF EXISTS accum_old(geometry);
 DROP AGGREGATE IF EXISTS st_accum_old(geometry);
 }}}

 In particular "st_geomunion(geometry)" seems to be a dangerous one, and
 now I wonder if it was the reason why we started dropping/recreating
 aggregates in "soft" upgrade procedures in the first place :/

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2560#comment:6>
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