in the command line?
psql -h 127.0.0.1 -U postgres postgres -c '\l'
this commands prompts for a password but I need a script to do this automatically
You can use .pgpass file https://www.postgresql.org/docs/13/libpq-pgpass.html
adde: export PGPASSWORD="password_db"
Is there a tutorial I can reference to please?
I tried this, also used export command but something does not seem right. The problem is still there.
jfyi - .pgpass is considered as the more correct way https://stackoverflow.com/questions/2893954/how-to-pass-in-password-to-pg-dump
Thanks ) this works!
Обсуждают сегодня