There is no definition of a port in the dsn string (used for pg_connect): https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/driver/postgresql.php#L119
I have compared it with ownCloud (where I know it works): https://github.com/owncloud/core/blob/master/lib/private/setup/postgresql.php#L21
I have (not well enough) tested the "// Fix database with port connection"-fix from ownCloud and it works with the default "localhost:1234" syntax. (But I don't know what happen if "port=false".)
// Fix database with port connection
$e_host = $this->options['host'];
if(strpos($e_host, ':')) {
list($e_host, $port)=explode(':', $e_host, 2);
} else {
$port=false;
}
// Build the DSN for the connection.
$dsn = "host='$e_host' port='$port' dbname={$this->options['database']} user={$this->options['user']} password={$this->options['password']}";
Maybe someone finds a better solution.
Category | ⇒ | Postgresql |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-08-27 10:19:54 |
Labels |
Added:
?
|
You're on the right track I'd say. For MySQLi, we do something similar to extract the port out (see https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/driver/mysqli.php#L103-L165). Would you be interested in sending a pull request?