]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL PDO: Support PgBouncer, unsupport PostgreSQL < 9.1 (bug #771)
authorJakub Vrana <jakub@vrana.cz>
Sat, 6 Feb 2021 15:45:20 +0000 (16:45 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sat, 6 Feb 2021 15:45:20 +0000 (16:45 +0100)
adminer/drivers/pgsql.inc.php
changes.txt

index 577afd4ffaa8a68073a91ca58f77a27e8bd7bf61..82196927fa249eda9b496c83f237b9b0151650b7 100644 (file)
@@ -150,8 +150,7 @@ if (isset($_GET["pgsql"])) {
                        function connect($server, $username, $password) {
                                global $adminer;
                                $db = $adminer->database();
-                               $string = "pgsql:host='" . str_replace(":", "' port='", addcslashes($server, "'\\")) . "' options='-c client_encoding=utf8'";
-                               $this->dsn("$string dbname='" . ($db != "" ? addcslashes($db, "'\\") : "postgres") . "'", $username, $password);
+                               $this->dsn("pgsql:host='" . str_replace(":", "' port='", addcslashes($server, "'\\")) . "' client_encoding=utf8 dbname='" . ($db != "" ? addcslashes($db, "'\\") : "postgres") . "'", $username, $password); //! client_encoding is supported since 9.1 but we can't yet use min_version here
                                //! connect without DB in case of an error
                                return true;
                        }
index bd22131bb7cf54d815047aef275664d2d1d38b03..a731bc3c67523b5d3e5c804dbb7c7306fbbb9384 100644 (file)
@@ -6,6 +6,7 @@ PostgreSQL: Export all FKs after all CREATE TABLE (PR #351)
 PostgreSQL: Fix dollar-quoted syntax highlighting (bug #738)
 PostgreSQL: Do not show view definition from other schema (PR #392)
 PostgreSQL: Use bigserial for bigint auto increment (bug #765, regression from 3.0.0)
+PostgreSQL PDO: Support PgBouncer, unsupport PostgreSQL < 9.1 (bug #771)
 PostgreSQL 10: Support GENERATED ALWAYS BY IDENTITY (PR #386)
 MS SQL: Don't truncate comments to 30 chars (PR #376)
 Editor: Cast to string when searching (bug #325)