Skip to content

Commit

Permalink
Fix postgres not supporting unix_socket.
Browse files Browse the repository at this point in the history
While it was documented as working, it totally didn't work.

Refs #6368
  • Loading branch information
markstory committed Apr 28, 2015
1 parent 50ec830 commit bf03c9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Database/Driver/Postgres.php
Expand Up @@ -57,8 +57,12 @@ public function connect()
PDO::ATTR_PERSISTENT => $config['persistent'],
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
];
if (empty($config['unix_socket'])) {
$dsn = "pgsql:host={$config['host']};port={$config['port']};dbname={$config['database']}";
} else {
$dsn = "pgsql:dbname={$config['database']}";
}

$dsn = "pgsql:host={$config['host']};port={$config['port']};dbname={$config['database']}";
$this->_connect($dsn, $config);
$this->_connection = $connection = $this->connection();
if (!empty($config['encoding'])) {
Expand Down

0 comments on commit bf03c9f

Please sign in to comment.