Mantis - Quercus
Viewing Issue Advanced Details
3683 minor always 09-09-09 18:23 11-14-10 16:34
nam  
 
normal  
new 4.0.0  
open  
none    
none  
0003683: PDO Can not connect Pgsql ,when pg port is not 5432.
(rep by junphine)

check the source ,it seems have a bug in

DataSource getPgsqlDataSource(Env env, String dsn){

StringBuilder url = new StringBuilder();
url.append("jdbc:postgresql://" [^]
url.append(host);

if (port != null){
url.append(port);
}

url.append('/');
url.append(dbname);

}

should add "url.append(':')" before "url.append(port)".

Notes
(0004837)
db   
11-14-10 16:34   
Bug confirmed to still exist in Quercus as distributed within Resin 4.0.13 or separately as "Quercus 4.0.11" (sill internally calling itself 4.0.7). As noted by the original poster, the errant code can be found in:

.../src/com/caucho/quercus/lib/db/PDO.java

in the method getPgsqlDataSource, around line 904:

if (port != null)
  url.append(port);

Fixed code:

if (port != null) {
  url.append(':');
  url.append(port);
}