If you are confident that your connection string is properly formatted as described by gnerkus, the final thing to investigate is your password. If it contains non-alphanumeric characters, that could be the source of the problem. It appears that either Node.js or the inner workings of JavaScript itself may be causing this issue (although I cannot confirm this as pg-admin connects fine using my original password).
My password contained special characters such as '+'
and '/'
(generated by creating a lengthy JSON filled with random text and then hashing it to produce a base64 string). When I removed these characters from both my connection string and database password, the issue was resolved.
Interestingly, the character '='
was actually acceptable. The problem seemed to stem from the URL decoding process on the database side. Sending '+'
likely caused it to be replaced with a space, leading to an incorrect password. Meanwhile, the presence of '/'
resulted in a malformed URL, triggering the "not found" error. Consider the following scenario:
postgres://username:sdkadady88da8+8ahdajd/ashdi==@localhost/database
The surplus '/'
here causes the URL to break down incorrectly. As a result,
protocol:// user:pass@host / database
transforms into
protocol:// [malformed user:pass@host] / [malformed database name] / [some gibberish]
. This can be traced back to the additional
'/'
.
If your colleague accessing it via JSF has the ability to adjust their connection string, I recommend updating the password to one that satisfies both systems. Otherwise, consider setting up another user/account with identical permissions but a different password suitable for use with Node.js.
EDIT:
Furthermore, based on suggestions from this discussion, attempting to encode the password section of your connection string might resolve the issue. Although I did not personally test this method after changing my own password, given that you continue experiencing difficulties, it would be wise to explore this solution prior to adopting one of the aforementioned approaches.