Skip site navigation (1) Skip section navigation (2)

Re: Password with libpq

From: "Tony and Bryn Reina" <reina_ga(at)hotmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Password with libpq
Date: 2004-06-28 15:11:02
Message-ID: BAY8-DAV37llSDcVjYC0003e64d@hotmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
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(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tony Reina" <reina_ga(at)hotmail(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Sent: Monday, June 28, 2004 12:12 AM
Subject: Re: [ADMIN] Password with libpq


> reina_ga(at)hotmail(dot)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
>

In response to

Responses

pgsql-admin by date

Next:From: Jose AlmeidaDate: 2004-06-28 16:49:21
Subject: Recover from a media failure
Previous:From: Eduardo S. FontanettiDate: 2004-06-28 13:50:24
Subject: Re: Insert binary data on postgre

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group