Checks for the presence of a "postgis_version" function,
and if found raises an exception with a message with
the schema containing it.
git-svn-id: http://svn.osgeo.org/postgis/trunk@12165
b70326c6-7e19-0410-871a-
916f4a2858ee
PostGIS 2.2.0
2014/MM/DD
- * Important / Breaking Changes *
+ * Important / Breaking Changes *
- #2565, ST_SummaryStats(tablename, rastercolumn, ...) uses
ST_SummaryStatsAgg()
BEGIN;
+-- Check that no other postgis is installed
+DO $$
+DECLARE
+ rec RECORD;
+BEGIN
+ FOR rec IN
+ SELECT n.nspname, p.proname FROM pg_proc p, pg_namespace n
+ WHERE p.proname = 'postgis_version'
+ AND p.pronamespace = n.oid
+ LOOP
+ RAISE EXCEPTION 'PostGIS is already installed in schema ''%'', uninstall it first', rec.nspname;
+ END LOOP;
+END
+$$ LANGUAGE 'plpgsql';
+
+
-- Let the user know about a deprecated signature and its new name, if any
CREATE OR REPLACE FUNCTION _postgis_deprecate(oldname text, newname text, version text)
RETURNS void AS