DATA_built=topology.sql topology_upgrade_20_minor.sql uninstall_topology.sql
# SQL objects (files requiring C pre-processing)
-SQL_OBJS=topology.sql.in
+SQL_OBJS=topology.sql.in topology_drop_before.sql.in topology_drop_after.sql.in
# Extra files to remove during 'make clean'
EXTRA_CLEAN=$(SQL_OBJS)
#Generate upgrade script by stripping things that can't be reinstalled
#e.g. don't bother with tables, types, triggers, and domains
-topology_upgrade_20_minor.sql: topology.sql
+topology_upgrade.sql: topology.sql
sed -e '/^\(CREATE\|ALTER\) \(CAST\|TYPE\|TABLE\|SCHEMA\|DOMAIN\|TRIGGER\).*;/d' \
-e '/^\(CREATE\|ALTER\) \(CAST\|TYPE\|TABLE\|SCHEMA\|DOMAIN\|TRIGGER\)/,/\;/d' \
$< > $@
+
+topology_upgrade_20_minor.sql: topology_drop_before.sql topology_upgrade.sql topology_drop_after.sql
+ cat $^ > $@
topology.sql.in: sql/sqlmm.sql sql/populate.sql sql/polygonize.sql sql/gml.sql sql/query/getnodebypoint.sql sql/query/getedgebypoint.sql sql/query/getfacebypoint.sql sql/query/GetRingEdges.sql sql/manage/TopologySummary.sql sql/manage/CopyTopology.sql sql/manage/ManageHelper.sql sql/topoelement/topoelement_agg.sql sql/topogeometry/type.sql sql/topogeometry/totopogeom.sql sql/predicates.sql
--- /dev/null
+-- $Id$
+-- PostGIS - Spatial Types for PostgreSQL
+-- http://www.postgis.org
+--
+-- Copyright (C) 2012 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.
+--
+--
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-- These are reserved for functions where the they are changed to use default args
+-- This is installed after the new functions are installed
+-- We don't have any of these yet for topology
+-- The reason we put these after install is
+-- you can't drop a function that is used by sql functions
+-- without forcing a drop on those as well which may cause issues with user functions.
+-- This allows us to CREATE OR REPLACE those in general topology.sql
+-- without dropping them.
+
--- /dev/null
+-- $Id$
+-- PostGIS - Spatial Types for PostgreSQL
+-- http://www.postgis.org
+--
+-- Copyright (C) 2012 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.
+--
+--
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-- These are functions where the argument names may have changed --
+-- so have to be dropped before upgrade can happen for 9.0+ --
+-- argument names changed --
+-- we might want to take toTopoGeom one out before release since
+-- I don't think too many people installed the bad name
+DROP FUNCTION IF EXISTS topology.toTopoGeom(Geometry, varchar, int, float8);
+