[postgis-tickets] r17304 - Try to drop the database before creating a new one, using a conditional drop in dropdb --if-exists

Paul Ramsey pramsey at cleverelephant.ca
Fri Mar 8 10:05:43 PST 2019


Author: pramsey
Date: 2019-03-08 10:05:43 -0800 (Fri, 08 Mar 2019)
New Revision: 17304

Modified:
   trunk/regress/run_test.pl
Log:
Try to drop the database before creating a new one, using a conditional drop in dropdb --if-exists


Modified: trunk/regress/run_test.pl
===================================================================
--- trunk/regress/run_test.pl	2019-03-08 16:35:05 UTC (rev 17303)
+++ trunk/regress/run_test.pl	2019-03-08 18:05:43 UTC (rev 17304)
@@ -1215,8 +1215,10 @@
 ##################################################################
 sub create_db
 {
-	my $cmd = "createdb --encoding=UTF-8 --template=template0 --lc-collate=C $DB > $REGRESS_LOG";
-	return system($cmd);
+	my $dropcmd = "dropdb --if-exists $DB > $REGRESS_LOG";
+	my $createcmd = "createdb --encoding=UTF-8 --template=template0 --lc-collate=C $DB > $REGRESS_LOG";
+	system($dropcmd);
+	return system($createcmd);
 }
 
 sub create_spatial



More information about the postgis-tickets mailing list