[postgis-tickets] r14640 - Revert accidentally committed revision

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


Author: strk
Date: 2016-02-09 02:05:46 -0800 (Tue, 09 Feb 2016)
New Revision: 14640

Added:
   tags/2.2.0/extensions/postgis/sql_bits/remove_from_extension.sql.in
Modified:
   tags/2.2.0/extensions/postgis/Makefile.in
   tags/2.2.0/postgis/postgis_drop_after.sql
   tags/2.2.0/regress/run_test.pl
Log:
Revert accidentally committed revision

Sorry, got fooled by git-svn


Modified: tags/2.2.0/extensions/postgis/Makefile.in
===================================================================
--- tags/2.2.0/extensions/postgis/Makefile.in	2016-02-09 09:48:51 UTC (rev 14639)
+++ tags/2.2.0/extensions/postgis/Makefile.in	2016-02-09 10:05:46 UTC (rev 14640)
@@ -74,15 +74,25 @@
 sql_bits/rtpostgis.sql: ../../raster/rt_pg/rtpostgis.sql
 	sed -e 's/BEGIN;//g' -e 's/COMMIT;//g'  $< > $@
 
+# we need to also drop this temporary function from the extension
+# for casts that are being dropped we need to drop them 
+# from extension only if they are in the existension so we use our postgis_extension_drop..
+# 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 .*\);/SELECT postgis_extension_drop_if_exists('${EXTENSION}', '\1');\n\1;/" \
+		-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/' \
 	$< > $@
 
+#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 "s/^\(DROP .*\);/SELECT postgis_extension_drop_if_exists('${EXTENSION}', '\1');\n\1;/" \
-	$< > $@
+		 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' \
+	 	 $< > $@
 
 
 ../../doc/raster_comments.sql:
@@ -93,8 +103,13 @@
 
 #postgis_raster_upgrade_minor.sql is the one that contains both postgis AND raster
 #TODO: come up with a better name
+#TODO: what about postgis_drop_after.sql ? where does it fit ??
 sql_bits/postgis_raster_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' > $@
+	# NOTE: good functions are always re-added by the upgrade scripts,
+	#       so unregistering them all here ensures the removed ones
+	#       can be removed on upgrade.
+	echo "SELECT postgis_extension_remove_objects('postgis', 'FUNCTION');" >> $@
 	cat $^ >> $@
 
 sql_minor_upgrade: sql_bits/postgis_raster_upgrade_minor.sql

Copied: tags/2.2.0/extensions/postgis/sql_bits/remove_from_extension.sql.in (from rev 14208, tags/2.2.0/extensions/postgis/sql_bits/remove_from_extension.sql.in)
===================================================================
--- tags/2.2.0/extensions/postgis/sql_bits/remove_from_extension.sql.in	                        (rev 0)
+++ tags/2.2.0/extensions/postgis/sql_bits/remove_from_extension.sql.in	2016-02-09 10:05:46 UTC (rev 14640)
@@ -0,0 +1,29 @@
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-- 
+----
+-- PostGIS - Spatial Types for PostgreSQL
+-- http://postgis.net
+--
+-- Copyright (C) 2011 Regina Obe <lr at pcorp.us>
+--
+-- 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 <lr at pcorp.us>
+--  
+-- 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');

Modified: tags/2.2.0/postgis/postgis_drop_after.sql
===================================================================
--- tags/2.2.0/postgis/postgis_drop_after.sql	2016-02-09 09:48:51 UTC (rev 14639)
+++ tags/2.2.0/postgis/postgis_drop_after.sql	2016-02-09 10:05:46 UTC (rev 14640)
@@ -28,14 +28,6 @@
 DROP AGGREGATE IF EXISTS accum_old(geometry);
 DROP AGGREGATE IF EXISTS st_accum_old(geometry);
 
-DROP AGGREGATE IF EXISTS st_astwkb_agg(geometry, integer); -- temporarely introduced before 2.2.0 final
-DROP AGGREGATE IF EXISTS st_astwkb_agg(geometry, integer, bigint); -- temporarely introduced before 2.2.0 final
-DROP AGGREGATE IF EXISTS st_astwkbagg(geometry, integer); -- temporarely introduced before 2.2.0 final
-DROP AGGREGATE IF EXISTS st_astwkbagg(geometry, integer, bigint); -- temporarely introduced before 2.2.0 final
-DROP AGGREGATE IF EXISTS st_astwkbagg(geometry, integer, bigint, boolean); -- temporarely introduced before 2.2.0 final
-DROP AGGREGATE IF EXISTS st_astwkbagg(geometry, integer, bigint, boolean, boolean); -- temporarely introduced before 2.2.0 final
-
-
 -- BEGIN Management functions that now have default param for typmod --
 DROP FUNCTION IF EXISTS AddGeometryColumn(varchar,varchar,varchar,varchar,integer,varchar,integer);
 DROP FUNCTION IF EXISTS AddGeometryColumn(varchar,varchar,varchar,integer,varchar,integer);
@@ -155,9 +147,3 @@
 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
-DROP FUNCTION IF EXISTS pgis_twkb_accum_transfn(internal,geometry,integer); -- temporarely introduced before 2.2.0 final
-DROP FUNCTION IF EXISTS pgis_twkb_accum_transfn(internal,geometry,integer,bigint); -- temporarely introduced before 2.2.0 final
-DROP FUNCTION IF EXISTS pgis_twkb_accum_transfn(internal,geometry,integer,bigint,bool); -- temporarely introduced before 2.2.0 final
-DROP FUNCTION IF EXISTS pgis_twkb_accum_transfn(internal,geometry,integer,bigint,bool,bool); -- temporarely introduced before 2.2.0 final
-DROP FUNCTION IF EXISTS pgis_twkb_accum_finalfn(internal); -- temporarely introduced before 2.2.0 final

Modified: tags/2.2.0/regress/run_test.pl
===================================================================
--- tags/2.2.0/regress/run_test.pl	2016-02-09 09:48:51 UTC (rev 14639)
+++ tags/2.2.0/regress/run_test.pl	2016-02-09 10:05:46 UTC (rev 14640)
@@ -209,7 +209,7 @@
 # Prepare the database
 ##################################################################
 
-my @dblist = grep(/\b$DB\b/, split(/\n/, `psql -Xl`));
+my @dblist = grep(/$DB/, split(/\n/, `psql -Xl`));
 my $dbcount = @dblist;
 
 if ( $dbcount == 0 )



More information about the postgis-tickets mailing list