Patch for PQconnectionUsedPassword brain-damage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-patches(at)postgreSQL(dot)org
Subject: Patch for PQconnectionUsedPassword brain-damage
Date: 2007-12-08 23:35:46
Message-ID: 28692.1197156946@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Per the thread here,
http://archives.postgresql.org/pgsql-hackers/2007-12/msg00174.php
the 8.3 patch to create "PQconnectionUsedPassword" is quite a few
bricks shy of a load --- the aforesaid function, which was intended
to serve two different purposes, fails to serve either one correctly.

Attached is my proposed patch to fix this, per the thread discussion.
But given that the misdesign was my fault to begin with, maybe some
other folk better look this over before it goes in :-(

The main bit of ugliness here is that conninfo_parse's API has to
be hacked up, because as it stands it's not possible for the caller
to tell whether a password came from the conninfo string or a
PGPASSWORD environment variable. It would perhaps be nicer to add
an "option source" enum field to struct PQconninfoOption, but that
would be a libpq ABI break which I don't think we want right now.
So I settled for an ugly special case, instead.

regards, tom lane

Attachment Content-Type Size
unknown_filename text/plain 18.3 KB

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-12-08 23:50:02 Re: [PATCH] automatic integer conversion
Previous Message Alvaro Herrera 2007-12-08 20:53:56 Re: [PATCH] automatic integer conversion