Re: BUG #13741: vacuumdb does not accept valid password - Mailing list pgsql-bugs

From Haribabu Kommi
Subject Re: BUG #13741: vacuumdb does not accept valid password
Date
Msg-id CAJrrPGcZDq-ts3Yx8SyRvKY5s+MTzDmXCL5WM3OQU56fvCcQSA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13741: vacuumdb does not accept valid password  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: BUG #13741: vacuumdb does not accept valid password  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-bugs
On Mon, Nov 2, 2015 at 6:53 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Mon, Nov 2, 2015 at 3:56 PM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
>> On Thu, Oct 29, 2015 at 9:13 AM, Haribabu Kommi
>> <kommi.haribabu@gmail.com> wrote:
>>> On Wed, Oct 28, 2015 at 4:07 PM, Haribabu Kommi
>>> <kommi.haribabu@gmail.com> wrote:
>>>> Here I attached a patch that saves the password provided by the user
>>>> from the connectDatabase function and reuse it for connecting all clients
>>>> to the same database.
>>>
>>> Attached a wrong patch, it is having some compilation problems,
>>> Here is the new version with the fixed problems.
>>
>> I have added an entry in this CF:
>> https://commitfest.postgresql.org/7/417/
>> Let's not lose track of this patch.

Thanks for adding the patch to commitfest.

> Regarding this patch, wouldn't it be clearer to pass the password as a
> variable of connectDatabase()? Then we could use NULL at the first
> call of connectDatabase so as we enforce the prompt if requested by
> the user. For successive calls of connectDatabase for each worker, we
> then fetch the password from the parent connection using that:
> if (PQconnectionUsedPassword(con))
>     password = PQpass(conn);
> And pass it as an argument of connectDatabase. In short, I think that
> this approach would make a more portable routine because one could
> enforce a password at the first call of connectDatabase() without
> having to save it once.

Thanks for the review.
Here I attached modified patch that gets the password from parent connection
if exists and use it for the child connection also.


Regards,
Hari Babu
Fujitsu Australia

Attachment

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #13741: vacuumdb does not accept valid password
Next
From: Michael Paquier
Date:
Subject: Re: BUG #13741: vacuumdb does not accept valid password