Re: BUG #8586: Misleading fe_sendauth error message - Mailing list pgsql-bugs

From Erik de Castro Lopo
Subject Re: BUG #8586: Misleading fe_sendauth error message
Date
Msg-id 20131111153654.ab7ec6477f8eaed7443c0131@mega-nerd.com
Whole thread Raw
In response to Re: BUG #8586: Misleading fe_sendauth error message  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom Lane wrote:

> Erik de Castro Lopo <mle+tools@mega-nerd.com> writes:
> > I haven't read the code, but my guess is that psql does the following:
>
> >  a) Grabs the user and database name from command line.
> >  b) Looks up dbname in pgpassfile to get host and port number etc.
> >  c) Connects to host:port and uses supplied username/password.
>
> No, you are mistaken.  The .pgpass file provides a password given
> a user/dbname/host/port to be connected to.  It is not the source
> of any data other than the password.
>
> You might want to look into the "service file" feature, which does
> allow various connection parameters to be provided from a single name.
>
> http://www.postgresql.org/docs/9.3/static/libpq-pgservice.html

Thanks, that looks like a better solution that the PGPASSFILE.

Cheers,
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #8586: Misleading fe_sendauth error message
Next
From: digoal
Date:
Subject: Re: BUG #8531: systemtap probe mark(checkpoint__done) error when i read the parameters