From: Sandro Santilli Date: Tue, 9 Feb 2016 08:28:56 +0000 (+0000) Subject: Wrap every DROP to first unregister object from postgis extension X-Git-Tag: 2.3.0beta1~267 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15dd1cb6ea2104daf5ecfbf20904ea59056c6a82;p=postgis Wrap every DROP to first unregister object from postgis extension Also drop temporarely introduced ST_AsTWKB signature. See #3450 git-svn-id: http://svn.osgeo.org/postgis/trunk@14631 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/extensions/postgis/Makefile.in b/extensions/postgis/Makefile.in index 002d62413..1bcb2f0c3 100644 --- a/extensions/postgis/Makefile.in +++ b/extensions/postgis/Makefile.in @@ -85,12 +85,12 @@ sql_bits/rtpostgis_upgrade.sql: ../../raster/rt_pg/rtpostgis_upgrade.sql $< > $@ #don't drop casts just yet since we don't have provision to remove from extension yet -#need to also drop temporary functions from extenions since it gets auto-added +#TODO: check the above statement, as I do see DROP CAST handled for raster instead sql_bits/postgis_upgrade.sql: ../../postgis/postgis_upgrade.sql sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \ -e '/^\(DROP\|CREATE\) \(CAST\).*;/d' \ -e '/^\(DROP\|CREATE\) \(CAST\)/,/\;/d' \ - -e 's/DROP FUNCTION postgis_major_version_check();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION postgis_major_version_check();DROP FUNCTION postgis_major_version_check();/g' \ + -e "s/^\(DROP .*\);/SELECT postgis_extension_drop_if_exists('${EXTENSION}', '\1');\1;/" \ $< > $@ @@ -101,7 +101,6 @@ sql_bits/raster_comments.sql: ../../doc/raster_comments.sql cp $< $@ #postgis_extension_upgrade_minor.sql is the one that contains both postgis AND raster -#TODO: what about postgis_drop_after.sql ? where does it fit ?? sql_bits/postgis_extension_upgrade_minor.sql: ../postgis_extension_helper.sql sql_bits/postgis_upgrade.sql sql_bits/rtpostgis_upgrade.sql ../../doc/raster_comments.sql ../../doc/postgis_comments.sql ../postgis_extension_helper_uninstall.sql echo '\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \quit' > $@ cat $^ >> $@ diff --git a/extensions/postgis/sql_bits/remove_from_extension.sql.in b/extensions/postgis/sql_bits/remove_from_extension.sql.in deleted file mode 100644 index 55dbbe3ef..000000000 --- a/extensions/postgis/sql_bits/remove_from_extension.sql.in +++ /dev/null @@ -1,29 +0,0 @@ --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- ----- --- PostGIS - Spatial Types for PostgreSQL --- http://postgis.net --- --- Copyright (C) 2011 Regina Obe --- --- This is free software; you can redistribute and/or modify it under --- the terms of the GNU General Public Licence. See the COPYING file. --- --- Author: Regina Obe --- --- This drops extension helper functions --- and should be called at the end of the extension upgrade file --- removes all postgis_topology functions from postgis_topology extension since they will be readded --- during upgrade -SELECT postgis_extension_remove_objects('postgis', 'FUNCTION'); -SELECT postgis_extension_remove_objects('postgis', 'AGGREGATE'); -SELECT postgis_extension_drop_if_exists('postgis', 'DROP VIEW raster_columns'); -SELECT postgis_extension_drop_if_exists('postgis', 'DROP TYPE wktgeomval'); -SELECT postgis_extension_drop_if_exists('postgis', 'DROP TYPE _wktgeomval'); -SELECT postgis_extension_drop_if_exists('postgis', 'DROP TYPE raster_columns'); -SELECT postgis_extension_drop_if_exists('postgis', 'DROP TYPE _raster_columns'); --- these got changed to out paramters in 2.1 -SELECT postgis_extension_drop_if_exists('postgis', 'DROP TYPE summarystats'); -SELECT postgis_extension_drop_if_exists('postgis', 'DROP TYPE quantile'); -SELECT postgis_extension_drop_if_exists('postgis', 'DROP TYPE valuecount'); -SELECT postgis_extension_drop_if_exists('postgis', 'DROP TYPE histogram'); diff --git a/postgis/postgis_drop_after.sql b/postgis/postgis_drop_after.sql index 12e05301e..bc38d636d 100644 --- a/postgis/postgis_drop_after.sql +++ b/postgis/postgis_drop_after.sql @@ -147,3 +147,4 @@ DROP FUNCTION IF EXISTS geography_gist_join_selectivity(internal, oid, internal, DROP FUNCTION IF EXISTS ST_AsBinary(text); -- deprecated in 2.0 DROP FUNCTION IF EXISTS postgis_uses_stats(); -- deprecated in 2.0 +DROP FUNCTION IF EXISTS st_astwkb(geometry,integer,bigint,bool,bool); -- temporarely introduced before 2.2.0 final