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 75d4d92212b6..0c0f2301ee6d 100644 --- a/user_guide_src/source/changelogs/v4.5.6.rst +++ b/user_guide_src/source/changelogs/v4.5.6.rst @@ -40,6 +40,7 @@ Bugs Fixed - **Routing:** Fixed a TypeError in `str_replace()` when `Routing::$translateURIDashes` is set to `true` and a route is defined using a closure. - **Validation:** Fixed a bug where complex language strings were not properly handled. +- **PostgreSQL Connection:** Fixed bug that PostgreSQL cannot reconnect the database with ``reconnect()`` method. See the repo's `CHANGELOG.md `_