diff --git a/system/Database/Postgre/Connection.php b/system/Database/Postgre/Connection.php index fe47c220a335..2826ab1bf53c 100644 --- a/system/Database/Postgre/Connection.php +++ b/system/Database/Postgre/Connection.php @@ -150,7 +150,8 @@ private function convertDSN() public function reconnect() { if ($this->connID === false || pg_ping($this->connID) === false) { - $this->connect(); + $this->close(); + $this->initialize(); } } diff --git a/user_guide_src/source/changelogs/v4.5.6.rst b/user_guide_src/source/changelogs/v4.5.6.rst index 8a486ae9de3f..223118058d81 100644 --- a/user_guide_src/source/changelogs/v4.5.6.rst +++ b/user_guide_src/source/changelogs/v4.5.6.rst @@ -41,6 +41,8 @@ Bugs Fixed - **Routing:** Fixed a TypeError in `str_replace()` when `Routing::$translateURIDashes` is set to `true` and a route is defined using a closure. +- **PostgreSQL Connection:** Fixed bug that PostgreSQL cannot reconnect the database with ``reconnect()`` method. + See the repo's `CHANGELOG.md `_ for a complete list of bugs fixed.