How to use password with special chars in postgressql .pgpass file
There's only one quoting rule for .pgpass according to the documentation:

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