X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d3604b8594ce1c2ec01bac675fc35b49ab8fc7df..5f19b23f49aee9989267ac03b488049f9d681166:/lib/setup/SetupClass.php diff --git a/lib/setup/SetupClass.php b/lib/setup/SetupClass.php index c14190c3..d3f59296 100755 --- a/lib/setup/SetupClass.php +++ b/lib/setup/SetupClass.php @@ -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']; }