Skip to content

Commit 61f8f55

Browse files
committed
Handle .pgpass in the native client
1 parent 95295ad commit 61f8f55

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

lib/connection-parameters.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
7777
if(this.database) {
7878
params.push("dbname='" + this.database + "'");
7979
}
80-
if(this.isDomainSocket) {
80+
if(this.host) {
8181
params.push("host=" + this.host);
82+
}
83+
if(this.isDomainSocket) {
8284
return cb(null, params.join(' '));
8385
}
8486
if(this.client_encoding) {

test/integration/client/heroku-pgpass-tests.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
var helper = require(__dirname + '/../test-helper');
22

3-
if (helper.args.native) {
4-
// do not run testwith native bindings,
5-
// see issue #475 (https://github.com/brianc/node-postgres/issues/475)
6-
process.exit();
7-
}
8-
93
// Path to the password file
104
var passfile = __dirname + '/heroku.pgpass';
115

126
// Export the path to the password file
137
process.env.PGPASSFILE = passfile;
148

15-
// Do a chmod 660, because git doesn't track thosepermissions
9+
// Do a chmod 660, because git doesn't track those permissions
1610
require('fs').chmodSync(passfile, 384);
1711

1812
var pg = helper.pg;

0 commit comments

Comments
 (0)