[postgis-tickets] r14642 - Wrap every DROP to first unregister object from postgis extension

Sandro Santilli strk at keybit.net
Tue Feb 9 02:12:05 PST 2016


Author: strk
Date: 2016-02-09 02:12:04 -0800 (Tue, 09 Feb 2016)
New Revision: 14642

Modified:
   branches/2.2/extensions/postgis/Makefile.in
Log:
Wrap every DROP to first unregister object from postgis extension

Also drop temporarely introduced ST_AsTWKB signature.
See #3450

Modified: branches/2.2/extensions/postgis/Makefile.in
===================================================================
--- branches/2.2/extensions/postgis/Makefile.in	2016-02-09 10:07:50 UTC (rev 14641)
+++ branches/2.2/extensions/postgis/Makefile.in	2016-02-09 10:12:04 UTC (rev 14642)
@@ -82,19 +82,13 @@
 # so that it will silently fail if cast is not in extension
 sql_bits/rtpostgis_upgrade.sql: ../../raster/rt_pg/rtpostgis_upgrade.sql
 	sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
-		-e 's/DROP FUNCTION _rename_raster_tables();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION _rename_raster_tables();DROP FUNCTION _rename_raster_tables();/g' \
-		-e 's/DROP FUNCTION _drop_st_samealignment();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION _drop_st_samealignment();DROP FUNCTION _drop_st_samealignment();/g' \
-		-e 's/DROP CAST\(.*\)/SELECT postgis_extension_drop_if_exists('\''$(EXTENSION)'\'', '\''DROP CAST \1'\'');DROP CAST \1/' \
+	    -e "s/^\(DROP .*\);/SELECT postgis_extension_drop_if_exists('${EXTENSION}', '\1');\n\1;/" \
 	$< > $@
 
-#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
 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' \
-	 	 $< > $@
+	sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
+	    -e "s/^\(DROP .*\);/SELECT postgis_extension_drop_if_exists('${EXTENSION}', '\1');\n\1;/" \
+	$< > $@
 
 
 ../../doc/raster_comments.sql:



More information about the postgis-tickets mailing list