?
avatar irbian
irbian
15 Nov 2017

Steps to reproduce the issue

Have a connection on a port different than the default and try to make a query on it

    $options = array();
    
    $options['driver']   = 'postgresql';        
    $options['host']     = '192.192.192.192:15432'; 
    $options['user']     = 'myuser';       
    $options['password'] = 'mypassword'; 
    $options['database'] = 'MYDATABASE';
    $options['prefix']   = '';             
    
    $dbo =  JDatabaseDriver::getInstance( $options );

Expected result

I expect to work

Actual result

"Error connecting to PGSQL database."

System information (as much as possible)

Additional comments

Looking at the code (https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/driver/postgresql.php#L122), looks like is missing the port option, as we can see on http://php.net/manual/es/function.pg-connect.php. Modifying the code and adding port=1532, make it work

As a workaround, I can set options['host'] as $options['host'] = '192.192.192.192 port=15432' and does the trick

avatar irbian irbian - open - 15 Nov 2017
avatar joomla-cms-bot joomla-cms-bot - change - 15 Nov 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Nov 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Nov 2017
Category Postgresql
avatar joomla-cms-bot joomla-cms-bot - edited - 15 Nov 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Jan 2018
Status New Information Required
avatar joomla-cms-bot joomla-cms-bot - edited - 26 Jan 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Jan 2018

@irbian is this still an Issue?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18578.

avatar irbian
irbian - comment - 26 Jan 2018

looking at the code, looks like still is

avatar zero-24
zero-24 - comment - 26 Jan 2018

Here are a first basic implementation of the port support please check that out: #19466 I'm open for feedback there on including also some kind of regex like we did for mysql for the port detection.

As we have a PR implementing this request I'm going to close this issue. Thanks!

avatar zero-24 zero-24 - close - 26 Jan 2018
avatar zero-24 zero-24 - change - 26 Jan 2018
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2018-01-26 22:59:51
Closed_By zero-24

Add a Comment

Login with GitHub to post a comment