[postgis-devel] upgrade from postgis2.4 to 3.0 requires dropping functions

Justin Pryzby pryzby at telsasoft.com
Sat Sep 28 14:07:25 PDT 2019


Yes, we use legacy functions; we haven't switched to using 'CREATE EXTENSION'
yet (I don't think we can install legacy stuff that way, so it seems not useful
to install postgis one way and its legacy functions another way).

It occured to me that possible I should've rerun "postgis_upgrade.sql" with the
latest 2.4 RPM before upgrading to 3.0.  But I think we *have* the latest 2.4
RPM (from PGDG), and I'd have to think about whether the pacakge would've ever
been updated since it was first installed.  So I think that probably isn't a
solution, for us at least.

I pulled the errors out of logs, sorry for not saving the the first time.

-[ RECORD 2 ]----------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:10:08.243-06
left     | cannot change name of input parameter "geom1"
detail   | 
query    | CREATE OR REPLACE FUNCTION _ST_LineCrossingDirection(line1 geometry, line2 geometry)                  +
         |         RETURNS integer                                                                               +
         |         AS '$libdir/postgis-3', 'ST_LineCrossingDirection'                                            +
         |         LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE                                                   +
         |         COST 10;
-[ RECORD 3 ]----------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:10:27.438-06
left     | cannot change name of input parameter "geometrya"
detail   | 
query    | CREATE OR REPLACE FUNCTION _ST_OrderingEquals(geom1 geometry, geom2 geometry)                         +
         |         RETURNS boolean                                                                               +
         |         AS '$libdir/postgis-3', 'LWGEOM_same'                                                         +
         |         LANGUAGE 'c' IMMUTABLE STRICT  PARALLEL SAFE                                                  +
         |         COST 10;

[... eliding my own errors here...]

-[ RECORD 5 ]----------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:10:42.418-06
left     | cannot change name of input parameter "geom1"
detail   |
query    | CREATE OR REPLACE FUNCTION ST_LineCrossingDirection(line1 geometry, line2 geometry)                   +
         |         RETURNS integer AS                                                                            +
         |         $$ SELECT CASE WHEN NOT $1 OPERATOR(&&) $2 THEN 0 ELSE _ST_LineCrossingDirection($1,$2) END $$+
         |         LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-[ RECORD 6 ]----------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:10:58.199-06
left     | cannot drop function st_combine_bbox(box3d,geometry) because other objects depend on it
detail   | function st_extent3d(geometry) depends on function st_combine_bbox(box3d,geometry)                    +
         | function extent(geometry) depends on function st_combine_bbox(box3d,geometry)
query    | DROP FUNCTION IF EXISTS st_combine_bbox(box3d, geometry);
-[ RECORD 7 ]----------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:11:14.194-06
left     | cannot drop function st_combine_bbox(box3d,geometry) because other objects depend on it
detail   | function st_extent3d(geometry) depends on function st_combine_bbox(box3d,geometry)                    +
         | function extent(geometry) depends on function st_combine_bbox(box3d,geometry)
query    | DROP FUNCTION st_combine_bbox(box3d,geometry);

[... eliding my own errors here...]

-[ RECORD 9 ]----------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:11:34.634-06
left     | cannot drop function st_combine_bbox(box3d,geometry) because other objects depend on it
detail   | function extent(geometry) depends on function st_combine_bbox(box3d,geometry)
query    | DROP FUNCTION IF EXISTS st_combine_bbox(box3d, geometry);
-[ RECORD 10 ]---------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:12:34.127-06
left     | function "extent3d" already exists with same argument types
detail   |
query    | CREATE AGGREGATE Extent3d(                                                                            +
         |         sfunc = combine_bbox,                                                                         +
         |         basetype = geometry,                                                                          +
         |         stype = box3d                                                                                 +
         |         );
-[ RECORD 11 ]---------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:12:34.127-06
left     | function "memcollect" already exists with same argument types
detail   |
query    | CREATE AGGREGATE memcollect(                                                                          +
         |         sfunc = ST_collect,                                                                           +
         |         basetype = geometry,                                                                          +
         |         stype = geometry                                                                              +
         |         );
-[ RECORD 12 ]---------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:13:36.998-06
left     | function "extent" already exists with same argument types
detail   |
query    | CREATE AGGREGATE Extent(                                                                              +
         |         sfunc = ST_CombineBbox,                                                                       +
         |         basetype = geometry,                                                                          +
         |         finalfunc = box2d,                                                                            +
         |         stype = box3d                                                                                 +
         |         );
-[ RECORD 13 ]---------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:13:37.042-06
left     | function "makeline" already exists with same argument types
detail   | 
query    | CREATE AGGREGATE makeline (                                                                           +
         |         BASETYPE = geometry,                                                                          +
         |         SFUNC = pgis_geometry_accum_transfn,                                                          +
         |         STYPE = internal,                                                                             +
         |         FINALFUNC = pgis_geometry_makeline_finalfn                                                    +
         |         );

-[ RECORD 14 ]---------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:13:37.132-06
left     | function "extent3d" already exists with same argument types
detail   |
query    | CREATE AGGREGATE Extent3d(                                                                            +
         |         sfunc = combine_bbox,                                                                         +
         |         basetype = geometry,                                                                          +
         |         stype = box3d                                                                                 +
         |         );
-[ RECORD 15 ]---------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:13:37.132-06
left     | function "memcollect" already exists with same argument types
detail   | 
query    | CREATE AGGREGATE memcollect(                                                                          +
         |         sfunc = ST_collect,                                                                           +
         |         basetype = geometry,                                                                          +
         |         stype = geometry                                                                              +
         |         );
-[ RECORD 16 ]---------------------------------------------------------------------------------------------------
log_time | 2019-09-27 10:13:37.136-06
left     | function "st_extent3d" already exists with same argument types
detail   | 
query    | CREATE AGGREGATE ST_Extent3D(                                                                         +
         |         sfunc = ST_CombineBbox,                                                                       +
         |         basetype = geometry,                                                                          +
         |         stype = box3d                                                                                 +
         |         );

Justin


More information about the postgis-devel mailing list