[postgis-tickets] r15935 - Add check for postgis raster being already installed

Sandro Santilli strk at kbt.io
Sun Oct 8 11:27:31 PDT 2017


Author: strk
Date: 2017-10-08 11:27:31 -0700 (Sun, 08 Oct 2017)
New Revision: 15935

Modified:
   trunk/raster/rt_pg/rtpostgis.sql.in
Log:
Add check for postgis raster being already installed

Modified: trunk/raster/rt_pg/rtpostgis.sql.in
===================================================================
--- trunk/raster/rt_pg/rtpostgis.sql.in	2017-10-08 18:20:00 UTC (rev 15934)
+++ trunk/raster/rt_pg/rtpostgis.sql.in	2017-10-08 18:27:31 UTC (rev 15935)
@@ -41,7 +41,22 @@
 BEGIN;
 SET LOCAL client_min_messages TO warning;
 
+-- Check that postgis raster is not already 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_raster_lib_version'
+    AND p.pronamespace = n.oid
+  LOOP
+    RAISE EXCEPTION 'PostGIS Raster is already installed in schema ''%''', rec.nspname;
+  END LOOP;
+END
+$$ LANGUAGE 'plpgsql';
 
+
 ------------------------------------------------------------------------------
 -- RASTER Type
 ------------------------------------------------------------------------------



More information about the postgis-tickets mailing list