Re: Password with libpq - Mailing list pgsql-admin

From Tom Lane
Subject Re: Password with libpq
Date
Msg-id 14320.1088374357@sss.pgh.pa.us
Whole thread Raw
In response to Password with libpq  (reina_ga@hotmail.com (Tony Reina))
List pgsql-admin
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

pgsql-admin by date:

Previous
From: reina_ga@hotmail.com (Tony Reina)
Date:
Subject: Password with libpq
Next
From: Frank Knobbe
Date:
Subject: Re: Insert binary data on postgre