Escaping ":" in .pgpass - code or docs bug?

From: Richard Huxton <dev(at)archonet(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Escaping ":" in .pgpass - code or docs bug?
Date: 2011-12-16 14:55:09
Message-ID: 4EEB5BCD.2070007@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 authentication failed 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2011-12-16 15:01:16 archive_keepalive_command
Previous Message Alvaro Herrera 2011-12-16 14:47:30 Re: Patch to allow users to kill their own queries