From d578798c1b2487ffb4dfc56d1e66bf6bfe08d33e Mon Sep 17 00:00:00 2001 From: Patrick McGraw Date: Sat, 5 Oct 2013 15:09:08 -0700 Subject: [PATCH] Fixing postgres host config This is a mismatch between the pg driver and what comes out of the url.parse() function. The pg driver expects host to not have a port number while url.parse() returns hostname as not having a port number. The pg driver performs a similar translation internally when using a raw string as the connection config. --- lib/Drivers/DML/postgres.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Drivers/DML/postgres.js b/lib/Drivers/DML/postgres.js index 12f13d74..fe9b1cdb 100644 --- a/lib/Drivers/DML/postgres.js +++ b/lib/Drivers/DML/postgres.js @@ -34,6 +34,9 @@ function Driver(config, connection, opts) { functions = switchableFunctions.pool; this.db = pg; } else { + if( this.config.hostname ) { + this.config.host = this.config.hostname; + } this.db = new pg.Client(this.config); } }