- private function pgsqlRunDropAndRestore($sDumpFile)
- {
- $sCMD = 'pg_restore'
- .' -p '.escapeshellarg($this->aDSNInfo['port'])
- .' -d '.escapeshellarg($this->aDSNInfo['database'])
- .' --no-owner -Fc --clean '.escapeshellarg($sDumpFile);
- if ($this->oDB->getPostgresVersion() >= 9.04) {
- $sCMD .= ' --if-exists';
- }
- if (isset($this->aDSNInfo['hostspec'])) {
- $sCMD .= ' -h '.escapeshellarg($this->aDSNInfo['hostspec']);
- }
- if (isset($this->aDSNInfo['username'])) {
- $sCMD .= ' -U '.escapeshellarg($this->aDSNInfo['username']);
- }
-
- $this->runWithPgEnv($sCMD);
- }
-