From: Tony and Bryn Reina <reina_ga@hotmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: Password with libpq
Date: Mon, 28 Jun 2004 17:11:02 +0200
Message-ID: <BAY8-DAV37llSDcVjYC0003e64d@hotmail.com> (raw)
References: <272e4be7.0406270913.7a65f99f@posting.google.com>
<14320.1088374357@sss.pgh.pa.us>
Thanks Tom. I found the relevant bit of code in the psql files. Looks like
it's just a simple loop that compares the error with the phrase
"fe_sendauth: no password supplied" and then prompts for the password and
tries again. Of course, if someone in the future decides to change the error
message, then the code gets broke. I doubt that's likely however.
-Tony
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Tony Reina" <reina_ga@hotmail.com>
Cc: <pgsql-admin@postgresql.org>
Sent: Monday, June 28, 2004 12:12 AM
Subject: Re: [ADMIN] Password with libpq
> reina_ga@hotmail.com (Tony Reina) writes:
> > However, what about in the general case where my client program
> > doesn't know if a password is required or not. Is there any libpq
> > function to query the server if a password is required? Perhaps,
> > there's a return value for PQconnectdb which would tell me that the
> > connection failed because of the password? (In which case, I can ask
> > for the password and try the connection again.)
>
> Look into the psql source code; it does essentially this.
>
> regards, tom lane
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: reina_ga@hotmail.com, tgl@sss.pgh.pa.us
Subject: Re: Password with libpq
In-Reply-To: <BAY8-DAV37llSDcVjYC0003e64d@hotmail.com>
References: <272e4be7.0406270913.7a65f99f@posting.google.com> <14320.1088374357@sss.pgh.pa.us> <BAY8-DAV37llSDcVjYC0003e64d@hotmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox