Skip to content

Commit 0c47a51

Browse files
committed
doc_queries_generator.pl drop/create with if exists
1 parent 1139dbf commit 0c47a51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/testers/doc_queries_generator.pl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ sub createTestDB {
385385
unless version_greater_eq($dbver, $POSGRESQL_MIN_VERSION);
386386

387387
# Create a database with postgis installed in it
388-
mysystem("createdb $connopts $databaseName");
388+
mysystem("createdb $connopts $databaseName") if !dbExists($databaseName);
389389
die "ERROR: Failed to create database '$databaseName'!\n" unless dbExists($databaseName);
390390
my $encoding = '';
391391
if ($OS =~ /msys/
@@ -398,6 +398,10 @@ sub createTestDB {
398398
if ($vpgr) {
399399
$myver = " VERSION '$vpgr'";
400400
}
401+
402+
403+
mysystem("$psql $connopts -c \"DROP EXTENSION IF EXISTS pgrouting $myver\" $databaseName ");
404+
401405
print "Installing pgrouting extension $myver\n" if $VERBOSE;
402406
mysystem("$psql $connopts -c \"CREATE EXTENSION pgrouting $myver CASCADE\" $databaseName");
403407

0 commit comments

Comments
 (0)