diff --git a/lib/connection-parameters.js b/lib/connection-parameters.js index aec183bb..df11d1cb 100644 --- a/lib/connection-parameters.js +++ b/lib/connection-parameters.js @@ -22,7 +22,9 @@ var parse = function(str) { var result = url.parse(str); var config = {}; config.host = result.hostname; - config.database = result.pathname ? result.pathname.slice(1) : null; + // not sure if postgres allows symbols in database names + // but we should allow them just in case + config.database = result.pathname ? decodeURI(result.pathname.slice(1)) : null; var auth = (result.auth || ':').split(':'); config.user = auth[0]; config.password = auth[1];