mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
BUGFIX Using dbname=postgres in PostgreSQLDatabaseConfigurationHelper to enable configuration checks with users other than 'postgres' (that might not have a database with their username)
This commit is contained in:
parent
b12b5f0e31
commit
77b972bfb5
@ -34,7 +34,7 @@ class PostgreSQLDatabaseConfigurationHelper implements DatabaseConfigurationHelp
|
|||||||
$server = $databaseConfig['server'];
|
$server = $databaseConfig['server'];
|
||||||
$userPart = $username ? " user=$username" : '';
|
$userPart = $username ? " user=$username" : '';
|
||||||
$passwordPart = $password ? " password=$password" : '';
|
$passwordPart = $password ? " password=$password" : '';
|
||||||
$connstring = "host=$server port=5432 {$userPart}{$passwordPart}";
|
$connstring = "host=$server port=5432 dbname=postgres {$userPart}{$passwordPart}";
|
||||||
|
|
||||||
$conn = @pg_connect($connstring);
|
$conn = @pg_connect($connstring);
|
||||||
if($conn) {
|
if($conn) {
|
||||||
@ -63,7 +63,7 @@ class PostgreSQLDatabaseConfigurationHelper implements DatabaseConfigurationHelp
|
|||||||
$server = $databaseConfig['server'];
|
$server = $databaseConfig['server'];
|
||||||
$userPart = $username ? " user=$username" : '';
|
$userPart = $username ? " user=$username" : '';
|
||||||
$passwordPart = $password ? " password=$password" : '';
|
$passwordPart = $password ? " password=$password" : '';
|
||||||
$connstring = "host=$server port=5432 {$userPart}{$passwordPart}";
|
$connstring = "host=$server port=5432 dbname=postgres {$userPart}{$passwordPart}";
|
||||||
|
|
||||||
$conn = @pg_connect($connstring);
|
$conn = @pg_connect($connstring);
|
||||||
if($conn) {
|
if($conn) {
|
||||||
|
Loading…
Reference in New Issue
Block a user