Escaping ":" in .pgpass - code or docs bug? - Mailing list pgsql-hackers

From Richard Huxton
Subject Escaping ":" in .pgpass - code or docs bug?
Date
Msg-id 4EEB5BCD.2070007@archonet.com
Whole thread Raw
Responses Re: Escaping ":" in .pgpass - code or docs bug?  (Ross Reedstrom <reedstrm@rice.edu>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Patch to allow users to kill their own queries
Next
From: Simon Riggs
Date:
Subject: archive_keepalive_command