From a945d722fce2c8a6fbc5baac491da430e013d2a6 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Thu, 5 Jan 2012 07:59:16 +0000 Subject: [PATCH] #1430: create topology_drop_before and topology_drop_after to allow changing names of input args and allow changing functions to use default args git-svn-id: http://svn.osgeo.org/postgis/trunk@8676 b70326c6-7e19-0410-871a-916f4a2858ee --- topology/Makefile.in | 7 +++++-- topology/topology_drop_after.sql.in.c | 19 +++++++++++++++++++ topology/topology_drop_before.sql.in.c | 17 +++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 topology/topology_drop_after.sql.in.c create mode 100644 topology/topology_drop_before.sql.in.c diff --git a/topology/Makefile.in b/topology/Makefile.in index 81a709c8e..9845269d8 100644 --- a/topology/Makefile.in +++ b/topology/Makefile.in @@ -27,7 +27,7 @@ MODULEDIR=contrib/$(PGIS_MODULE_big) 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) @@ -61,10 +61,13 @@ $(SQL_OBJS): %.in: %.in.c #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 diff --git a/topology/topology_drop_after.sql.in.c b/topology/topology_drop_after.sql.in.c new file mode 100644 index 000000000..c7e8658e3 --- /dev/null +++ b/topology/topology_drop_after.sql.in.c @@ -0,0 +1,19 @@ +-- $Id$ +-- PostGIS - Spatial Types for PostgreSQL +-- http://www.postgis.org +-- +-- Copyright (C) 2012 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. +-- +-- +-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-- 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. + diff --git a/topology/topology_drop_before.sql.in.c b/topology/topology_drop_before.sql.in.c new file mode 100644 index 000000000..2a4d24ff9 --- /dev/null +++ b/topology/topology_drop_before.sql.in.c @@ -0,0 +1,17 @@ +-- $Id$ +-- PostGIS - Spatial Types for PostgreSQL +-- http://www.postgis.org +-- +-- Copyright (C) 2012 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. +-- +-- +-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-- 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); + -- 2.40.0