Re: [PATCH] pgpassfile connection option

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: [PATCH] pgpassfile connection option
Дата
Msg-id alpine.DEB.2.20.1610271438460.32179@lancre
обсуждение исходный текст
Ответ на Re: [PATCH] pgpassfile connection option  (Julian Markwort <julian.markwort@uni-muenster.de>)
Ответы Re: [PATCH] pgpassfile connection option  (Julian Markwort <julian.markwort@uni-muenster.de>)
Список 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.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Radix tree for character conversion
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [BUG] pg_basebackup from disconnected standby fails