Closed barbatrukko closed 2 years ago
I assume you followed this article?
https://zwbetz.com/connect-to-a-postgresql-database-and-run-a-query-from-a-bash-script/
In order to help you, you'll need to post your bash script file here. Otherwise I have nothing to work from.
It’s also possible that your password has special characters that are being (unintentionally) interpreted by bash.
So in your .env
file change this:
PGPASSWORD="some_password"
To use single quotes:
PGPASSWORD='some_password'
Hi, yes this was the problem. In the password there is $ char. now I used ' instead of " and works
Tnx
Glad to hear that worked.
I updated the articles to use single quotes https://github.com/zwbetz-gh/zwbetz/commit/208def8cbd275f61eb9c7d8f055e6ec786bedd3e
Closing this
I created file as you wrote on your article. Credential are the same used from a jar file running on the same server
psql: error: could not connect to server: FATAL: password authentication failed for user "myuser" FATAL: password authentication failed for user "myuser"
psql 12.4 on ubuntu 18.4.5