Re: BUG #4040: psql should provide option to not prompt for password - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4040: psql should provide option to not prompt for password
Date
Msg-id 9362.1205765315@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #4040: psql should provide option to not prompt for password  (Martin Pitt <martin@piware.de>)
Responses Re: BUG #4040: psql should provide option to not prompt for password
List pgsql-bugs
Martin Pitt <martin@piware.de> writes:
>          if (PQstatus(pset.db) == CONNECTION_BAD &&
>              PQconnectionNeedsPassword(pset.db) &&
> -            password == NULL &&
> +            password == NULL && !getenv("PGPASSWORD") &&
>              !feof(stdin))
>          {
>              PQfinish(pset.db);

What exactly do you think that accomplishes?  AFAICS
PQconnectionNeedsPassword can't possibly return true if there was a
password available from PGPASSWORD (regardless of whether it was
correct or not).

            regards, tom lane

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #4040: psql should provide option to not prompt for password
Next
From: Tom Lane
Date:
Subject: Re: BUG #4040: psql should provide option to not prompt for password