According to the docs [1], you should escape embedded colons in .pgpass
(fair enough). Below is PG 9.1.1
user = "te:st", db = "te:st", password = "te:st"
$ cat ~/.pgpass *:*:te:st:te:st:te:st $ psql91 -U "te:st" -d "te:st" te:st=>
$ cat ~/.pgpass *:*:te\:st:te\:st:te:st $ psql91 -U "te:st" -d "te:st" te:st=>
$ cat ~/.pgpass *:*:te\:st:te\:st:te\:st $ psql91 -U "te:st" -d "te:st" psql: FATAL: password
authenticationfailed for user "te:st" password retrieved from file "/home/richardh/.pgpass"
I'm a bit puzzled how it manages without the escaping in the first case.
There's a lack of consistency though that either needs documenting or
fixing.
[1] http://www.postgresql.org/docs/9.1/static/libpq-pgpass.html
-- Richard Huxton Archonet Ltd