Skip to content

Commit b87090a

Browse files
committed
PostgreSQL: Fix connecting via TCP/IP if server is not specified (regression from 5.2.1)
1 parent 5c5c089 commit b87090a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
AdminNeo 5.3.0
5+
--------------
6+
7+
### Bugfixes
8+
9+
- PostgreSQL: Fix connecting via TCP/IP if server is not specified (regression from 5.2.1)
10+
411
AdminNeo 5.2.1 (2025-12-07)
512
---------------------------
613

admin/drivers/pgsql.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PgSqlConnection extends Connection
2323
private $connectionString;
2424

2525
/** @var bool */
26-
private $hasDefaultDatabase = true;
26+
private $hasDefaultDatabase;
2727

2828
public function open(string $server, string $username, string $password): bool
2929
{
@@ -49,6 +49,8 @@ public function open(string $server, string $username, string $password): bool
4949
// try to connect directly with database for performance
5050
$this->hasDefaultDatabase = false;
5151
$this->connection = @pg_connect("$this->connectionString dbname='postgres'", PGSQL_CONNECT_FORCE_NEW);
52+
} else {
53+
$this->hasDefaultDatabase = true;
5254
}
5355

5456
restore_error_handler();

0 commit comments

Comments
 (0)