diff --git a/src/Sql/SqlPgsql.php b/src/Sql/SqlPgsql.php index b4014b46fb..9c98c01d0a 100644 --- a/src/Sql/SqlPgsql.php +++ b/src/Sql/SqlPgsql.php @@ -112,9 +112,9 @@ public function dbExists(): bool $process = Drush::shell($sql_no_db->connect() . ' -t -c ' . escapeshellarg($query), null, $this->getEnv()); $process->setSimulated(false); $process->run(); - $out = $process->getOutput(); - // If there is output the DB exists. - return (bool)$out; + + return $process->isSuccessful() + && trim($process->getOutput()) === '1'; } public function queryFormat($query)