[postgis-tickets] [PostGIS] #2665: Extension upgrade needs to selectively drop from extension aggregates and functions
PostGIS
trac at osgeo.org
Fri Mar 7 05:27:09 PST 2014
#2665: Extension upgrade needs to selectively drop from extension aggregates and
functions
-----------------------------------+----------------------------------------
Reporter: robe | Owner: strk
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.1.2
Component: build/upgrade/install | Version: 2.1.x
Keywords: |
-----------------------------------+----------------------------------------
Comment(by robe):
none I have tested or think I CAN test since we haven't dropped anything
that isn't in the drop before/after scripts. I just scanned the generated
extension script and expected for example where you have your
autogenerated $postgis_proc_upgrade$ DOs
like this case
{{{
EXECUTE 'DROP AGGREGATE IF EXISTS ST_Extent(geometry)';
}}}
it should be:
{{{
SELECT postgis_extension_drop_if_exists('postgis', 'DROP AGGREGATE IF
EXISTS ST_Extent(geometry);')
EXECUTE 'DROP AGGREGATE IF EXISTS ST_Extent(geometry)';
}}}
My sed script doesn't replace that construct since I think I only touch
the drop/before after scripts to prevent from messing up plpgsql
functions.
Since you are doing an EXECUTE anyway wondering if maybe we should move
the postgis_extension_drop_if_exists function up (rather create a new one
that does your DO and drops from extension) as part of regular upgrade
machinery and you just change your EXECUTE to use that new function.
The only reason I had to create that function is because the drop from
extension logic doesn't have a DROP IF EXISTS option, so the function just
tries to drop from the extension and ignores if it gets an error (that
means the extension doesn't have it).
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2665#comment:2>
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