Skip to content

Commit 55970d0

Browse files
committed
fix: PostgreSQL version
It seems PostgreSQL may return the version like '15.3 (Debian 15.3-1.pgdg110+1)'.
1 parent 00993a3 commit 55970d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

system/Database/Postgre/Connection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ public function getVersion(): string
133133
}
134134

135135
$pgVersion = pg_version($this->connID);
136-
$this->dataCache['version'] = $pgVersion['server'] ?? '';
136+
$this->dataCache['version'] = isset($pgVersion['server']) ?
137+
(preg_match('/^(\d+\.\d+)/', $pgVersion['server'], $matches) ? $matches[1] : '') :
138+
'';
137139

138140
return $this->dataCache['version'];
139141
}

0 commit comments

Comments
 (0)