Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfjFH-0007Vx-RG for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Nov 2013 04:37:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VfjFH-0005d9-Aj for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Nov 2013 04:37:03 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfjFG-0005d2-BQ for pgsql-bugs@postgresql.org; Mon, 11 Nov 2013 04:37:02 +0000 Received: from hendrix.mega-nerd.net ([203.206.230.162]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VfjF9-0003e9-CT for pgsql-bugs@postgresql.org; Mon, 11 Nov 2013 04:37:01 +0000 Received: from rollins.mnn (pharoah-vpn [10.9.8.2]) by hendrix.mega-nerd.net (Postfix) with SMTP id 4B6B8106EA4; Mon, 11 Nov 2013 15:36:54 +1100 (EST) Date: Mon, 11 Nov 2013 15:36:54 +1100 From: Erik de Castro Lopo To: pgsql-bugs@postgresql.org Cc: Tom Lane Subject: Re: BUG #8586: Misleading fe_sendauth error message Message-Id: <20131111153654.ab7ec6477f8eaed7443c0131@mega-nerd.com> In-Reply-To: <23838.1384143978@sss.pgh.pa.us> References: <23565.1384143116@sss.pgh.pa.us> <20131111151938.36cb6bcaf4b83b70b0d068aa@mega-nerd.com> <23838.1384143978@sss.pgh.pa.us> Reply-To: pgsql-bugs@postgresql.org Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed 3.4.0beta6 (GTK+ 2.24.22; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Tom Lane wrote: > Erik de Castro Lopo 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/ -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs