I have a multi tenant node application. I'm encountering an issue when trying to connect to local PostgreSQL database using node-postgres. Whenever the program attempt to execute a function (internally executing a SQL query), I receive the following error message:
error: password authentication failed for user "abc"
Since this is a multi-tenant application in the database it has multiple schemas and also multiple roles, it has the schema called abc and also the user abc as well.
I've double-checked the username and password and even updated it multiple times. However, I'm still getting the above error. Also, in PgAdmin if I execute the same query using the same user abc it is executing the query fine.
I'm unsure why the authentication is failing despite providing the correct credentials. Could someone please advise on potential troubleshooting steps or solutions to resolve this issue? Also, how can I turn on the debug logs for this node-postgres?
Thank you in advance for your assistance!
postgres. And even for every role I changed the password multiple times. So I added a new record to thepg_hba.conffile by changing the method totrust(default was scram-sha-256) and it worked (I know it is not recommended), but still I don't understand why it didn't work, is this an issue with may be authentication mechanism not supported or database migration version issue? I still cannot figure it out, can I get some hints?Postgreslogs also.