How to use password with special chars like repl#stg$12 in postgressql .pgpass file? db1:5433:replication:repl:repl#stg$12 I added entry like this in .pgpass but it's prompting for password when I connect.

  • 2
    There is no problem with those special characters in the password. The problem is probably with "replication", which is kind of a magic name. Are you trying to connect as a replication user, or to a database named "replication"? Please show the command line or configuration line involved.
    – jjanes
    May 22 '21 at 2:18

There's only one quoting rule for .pgpass according to the documentation:

 If an entry needs to contain : or \, escape this character with \.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.