Skip to content

Commit cce5ad7

Browse files
emilbayesporsager
authored andcommitted
Fix standard postgres user env var (porsager#20)
* Fix standard postgres user env var psql defined PGUSER, not PGUSERNAME * Preserve existing behaviour Then the wrong env var can go in the next major
1 parent cbe7cac commit cce5ad7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ function parseOptions(a, b) {
460460
port,
461461
path : o.path || host.indexOf('/') > -1 && host + '/.s.PGSQL.' + port,
462462
database : o.database || o.db || (url.pathname || '').slice(1) || env.PGDATABASE || 'postgres',
463-
user : o.user || o.username || auth[0] || env.PGUSERNAME || os.userInfo().username,
463+
user : o.user || o.username || auth[0] || env.PGUSERNAME || env.PGUSER || os.userInfo().username,
464464
pass : o.pass || o.password || auth[1] || env.PGPASSWORD || '',
465465
max : o.max || url.query.max || Math.max(1, os.cpus().length),
466466
types : o.types || {},

0 commit comments

Comments
 (0)