On 6/19/20 7:17 AM, pepevo wrote: > I understand your post about "password does not take an argument, it is > meant to be used as is. The purpose is to force a password prompt." When > I used -W and --password=. That's what I said I will try pgpassfile. > Thought it like mysq/oracle can indicate out without creating password > file.
If you want to expose your password in the script file then:
"An alternative way to specify connection parameters is in a conninfo string or a URI, which is used instead of a database name. This mechanism give you very wide control over the connection. For example:
This way you can also use LDAP for connection parameter lookup as described in Section 33.17. See Section 33.1.2 for more information on all the available connection options."
Ok, so not "no way", but it's still a bad idea given the availability of other better options. Namely PGPASSWORD, .pgpass, or, less desirably.pg_service.conf
The URI format that includes a password should be reserved for client libraries and avoided when using psql (just the password part really though I much prefer the service file option myself).