Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1egDk4-00049t-3S for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Jan 2018 18:01:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egDk3-0000Ik-3e for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Jan 2018 18:01:15 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1egDk2-0000Ia-Qu for pgsql-bugs@lists.postgresql.org; Mon, 29 Jan 2018 18:01:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1egDk0-0005Qx-8f for pgsql-bugs@lists.postgresql.org; Mon, 29 Jan 2018 18:01:13 +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 w0TI198C004170; Mon, 29 Jan 2018 13:01:09 -0500 From: Tom Lane To: Bruce Momjian cc: akos@elegran.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15025: PSQL CLI - inconsistency when both -d and -U supplies a username In-reply-to: <16151.1517173540@sss.pgh.pa.us> References: <20180123130013.7407.24749@wrigleys.postgresql.org> <20180128034832.GD9153@momjian.us> <29202.1517168326@sss.pgh.pa.us> <20180128200418.GA4380@momjian.us> <14400.1517171454@sss.pgh.pa.us> <20180128203633.GC4380@momjian.us> <16151.1517173540@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 28 Jan 2018 16:05:40 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4168.1517248869.1@sss.pgh.pa.us> Date: Mon, 29 Jan 2018 13:01:09 -0500 Message-ID: <4169.1517248869@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > So I now think the comment I added to do_connect() is unduly pessimistic, > and it's fine to keep using "prompt_for_password(user)" for a forced > password prompt there. There may still be use-cases where it gets it > wrong, but they're too narrow to be worth giving up the helpful prompt > altogether. After further thought about that I changed my mind again: it seems better to be able to say "we never issue a misleading password prompt" than that "it's right 99% of the time" --- and it looks like in some cases with nondefault reuse_previous_specification, we'd still get it wrong. So I made it shorten the prompt if the dbname is a connstring or URI. Committed with that change. regards, tom lane