Re: BUG #4040: psql should provide option to not prompt for password
От | Martin Pitt |
---|---|
Тема | Re: BUG #4040: psql should provide option to not prompt for password |
Дата | |
Msg-id | 20080317170728.GB19155@piware.de обсуждение исходный текст |
Ответ на | Re: BUG #4040: psql should provide option to not prompt for password (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-bugs |
Tom Lane [2008-03-17 10:48 -0400]: > 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). I don't claim to understand the complete code behind PQconnectionNeedsPassword(). I just found that in at least 8.3RC1, this did return True if pg_hba.conf set password authentication and none was provided. I tried every trick that came into my mind, redirecting stdin, using PGPASSWORD, and I think even a fake empty .pgpass file, nothing worked. Martin -- Martin Pitt | http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
В списке pgsql-bugs по дате отправления: