]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge branch 'markdown-syntax-fix-gb-postcodes' of https://github.com/mtmail/Nominati...
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 29 Apr 2019 21:12:37 +0000 (23:12 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 29 Apr 2019 21:12:37 +0000 (23:12 +0200)
lib/setup/SetupClass.php

index c14190c3a1be66020216defca9686262ac44f3f0..d3f59296a23d35a91128ed7e0d083e6ded444fd4 100755 (executable)
@@ -753,7 +753,10 @@ class SetupFunctions
 
     private function pgsqlRunDropAndRestore($sDumpFile)
     {
-        $sCMD = 'pg_restore -p '.$this->aDSNInfo['port'].' -d '.$this->aDSNInfo['database'].' -Fc --clean '.$sDumpFile;
+        $sCMD = 'pg_restore -p '.$this->aDSNInfo['port'].' -d '.$this->aDSNInfo['database'].' --no-owner -Fc --clean '.$sDumpFile;
+        if ($this->oDB->getPostgresVersion() >= 9.04) {
+            $sCMD .= ' --if-exists';
+        }
         if (isset($this->aDSNInfo['hostspec'])) {
             $sCMD .= ' -h '.$this->aDSNInfo['hostspec'];
         }