]> granicus.if.org Git - postgis/commitdiff
[run_test] Drop raster if needed when enforced by extension
authorSandro Santilli <strk@kbt.io>
Mon, 24 Sep 2018 10:18:15 +0000 (10:18 +0000)
committerSandro Santilli <strk@kbt.io>
Mon, 24 Sep 2018 10:18:15 +0000 (10:18 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@16840 b70326c6-7e19-0410-871a-916f4a2858ee

regress/run_test.pl

index 1376d5cb3405a4407ea8b1bb2d114edda2ec30b9..d1af067533eeb27f36a874c9e0aadf2dc13300df 100755 (executable)
@@ -1509,6 +1509,30 @@ sub upgrade_spatial_extensions
         }
       }
     }
+               else
+               {
+                       # Raster support was not requested, so drop it if
+                       # left unpackaged
+      if ( $OPT_UPGRADE_FROM
+           && ! has_split_raster_ext($OPT_UPGRADE_FROM) )
+                       {
+        $sql = "CREATE EXTENSION postgis_raster VERSION '${nextver}' FROM unpackaged";
+        $cmd = "psql $psql_opts -c \"" . $sql . "\" $DB >> $REGRESS_LOG 2>&1";
+        $rv = system($cmd);
+        if ( $rv ) {
+          fail "Error encountered creating EXTENSION POSTGIS_RASTER from unpackaged on upgrade", $REGRESS_LOG;
+          die;
+        }
+
+        $sql = "DROP EXTENSION postgis_raster";
+        $cmd = "psql $psql_opts -c \"" . $sql . "\" $DB >> $REGRESS_LOG 2>&1";
+        $rv = system($cmd);
+        if ( $rv ) {
+          fail "Error encountered dropping EXTENSION POSTGIS_RASTER on upgrade", $REGRESS_LOG;
+          die;
+        }
+                       }
+               }
 
     if ( $OPT_WITH_TOPO )
     {