Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vfir7-0006am-KV for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Nov 2013 04:12:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vfir7-0001ur-08 for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Nov 2013 04:12:05 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vfir6-0001uh-Bm for pgsql-bugs@postgresql.org; Mon, 11 Nov 2013 04:12:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vfir4-0003BU-3u for pgsql-bugs@postgresql.org; Mon, 11 Nov 2013 04:12:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id rAB4Bu9U023566; Sun, 10 Nov 2013 23:11:56 -0500 From: Tom Lane To: mle+tools@mega-nerd.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8586: Misleading fe_sendauth error message In-reply-to: References: Comments: In-reply-to mle+tools@mega-nerd.com message dated "Mon, 11 Nov 2013 03:44:43 +0000" Date: Sun, 10 Nov 2013 23:11:56 -0500 Message-ID: <23565.1384143116@sss.pgh.pa.us> X-Pg-Spam-Score: -0.0 (/) 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 mle+tools@mega-nerd.com writes: > Running the command: > PGPASSFILE=pgpass psql --no-password --username myname mydb > --command="\dt" > works fine if the port number in the pgpass file is correct, but if the port > number is incorrect the error message is: > psql: fe_sendauth: no password supplied > which is highly misleading. Surely the error message should be "connection > refused" or some such? I'm not sure how we could improve that. If the port number in the password file doesn't match the intended connection, that means the entry doesn't apply to this connection. We can hardly issue error messages on the basis of the presence of unrelated entries in a .pgpass file. So what the code is seeing is that the server demanded a password (or so I'd assume), and it did not have one to give. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs