]> granicus.if.org Git - postgis/commitdiff
Revert "Unregister all functions before starting postgis extention upgrade"
authorSandro Santilli <strk@keybit.net>
Mon, 8 Feb 2016 17:16:12 +0000 (17:16 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 8 Feb 2016 17:16:12 +0000 (17:16 +0000)
This reverts r14629 (see #3450)

The code was broken (but the idea is still good to evaluate)

git-svn-id: http://svn.osgeo.org/postgis/trunk@14630 b70326c6-7e19-0410-871a-916f4a2858ee

extensions/postgis/Makefile.in
extensions/postgis/sql_bits/remove_from_extension.sql.in [new file with mode: 0644]
postgis/postgis_drop_after.sql

index b693d9618d2416afec18c6903b312e7d59c8fda9..002d62413402a12f294283a75e4747f2a2134a16 100644 (file)
@@ -100,14 +100,10 @@ sql_bits/postgis_upgrade.sql: ../../postgis/postgis_upgrade.sql
 sql_bits/raster_comments.sql: ../../doc/raster_comments.sql
        cp $< $@
 
-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
 #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' > $@
-       # 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_extension_upgrade_minor.sql
diff --git a/extensions/postgis/sql_bits/remove_from_extension.sql.in b/extensions/postgis/sql_bits/remove_from_extension.sql.in
new file mode 100644 (file)
index 0000000..55dbbe3
--- /dev/null
@@ -0,0 +1,29 @@
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-- 
+----
+-- PostGIS - Spatial Types for PostgreSQL
+-- http://postgis.net
+--
+-- Copyright (C) 2011 Regina Obe <lr@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@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');
index bc38d636de85d461a8a4e7b5358f45d19dceee92..12e05301e0207cd0c872320d90be43a13f5f1577 100644 (file)
@@ -147,4 +147,3 @@ 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