Re: [PATCH] pgpassfile connection option

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Julian Markwort <julian(dot)markwort(at)uni-muenster(dot)de>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] pgpassfile connection option
Date: 2016-10-27 12:52:17
Message-ID: alpine.DEB.2.20.1610271438460.32179@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>> I would suggest that the struct gets the value (from option, environment or
>> default) and is always used elsewhere. The getPgPassFilename function
>> should disappear and PasswordFromFile should be simplified significantly.
> I agree, however that's easier said than done because the "default" is only
> constant by its definition, not by its location.
> There is no "default" location as the home directory depends not only on the
> system but also on the user. Afaics we can't entirely get rid of a function
> to get the location of the default .pgpass file.

Hmmm... I thought to put the default if not set from the connection option
or the environment variable, say in connectOptions2(), just before getting
the password if it is needed? That is ensure that the pgpassfile field is
not NULL before calling PasswordFromFile, so that PasswordFromFile does
not have to do anything and then the error message can rely on the
pgpassfile field?

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-10-27 13:05:45 Re: [BUG] pg_basebackup from disconnected standby fails
Previous Message Dilip Kumar 2016-10-27 12:23:39 Re: Speed up Clog Access by increasing CLOG buffers