Skip to content

Commit

Permalink
Fix PostgreSQL getVersion() logic
Browse files Browse the repository at this point in the history
  • Loading branch information
marekmosna committed May 10, 2023
1 parent 42b174f commit 7ee8775
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ public function getVersion(): string
return $this->dataCache['version'];
}

if (! $this->connID || ($pgVersion = pg_version($this->connID)) === false) {
if (!$this->connID) {
$this->initialize();
}

$pgVersion = pg_version($this->connID);

return isset($pgVersion['server']) ? $this->dataCache['version'] = $pgVersion['server'] : false;
}

Expand Down

0 comments on commit 7ee8775

Please sign in to comment.