pg-promise does not understand UTF passwords?.. I can't make it work with them. Tried on linux and osx, postgres 9.3, 9.5 - seems to be not specific to versions. Looked into code. pg-promise uses pg, which uses pg-connect-string which is build based on back pg. Can't find the the root of the problem. Please help.
code to reproduce:
MacBook-Air:js vao$ cat 2.js
var pgp = require("pg-promise")(); var cs = 'postgresql://utf:утф@127.0.0.1:5433/a'; var db = pgp(cs); db.connect() .then(function (obj) { obj.done(); // success, release the connection; }) .catch(function (error) { console.log("ERROR:", error.message || error); }); console.log(cs);
returns:
MacBook-Air:js vao$ node 2.js
postgresql://utf:утф@127.0.0.1:5433/a ERROR: password authentication failed for user "utf"
Using same connection string with psql
:
MacBook-Air:js vao$ psql 'postgresql://utf:утф@127.0.0.1:5433/a'
psql (9.5.3) Type "help" for help. a=> \q
Trying bad password deliberately with same connection string:
MacBook-Air:js vao$ psql 'postgresql://utf:утфWrongPassword@127.0.0.1:5433/a'
psql: FATAL: password authentication failed for user "utf" MacBook-Air:js vao$