Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDSfq-0003Sk-7Q for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2020 13:19:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDSfI-0007Mj-Mm for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2020 13:19:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDSfI-0007Mb-GN for pgsql-bugs@lists.postgresql.org; Wed, 02 Sep 2020 13:19:04 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDSfF-0002HK-MT for pgsql-bugs@lists.postgresql.org; Wed, 02 Sep 2020 13:19:04 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kDSfC-0004ti-82; Wed, 02 Sep 2020 09:18:58 -0400 Date: Wed, 2 Sep 2020 09:18:58 -0400 From: Bruce Momjian To: Oleksandr Shulgin Cc: Tom Lane , "David G. Johnston" , exclusion@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #16486: Prompted password is ignored when password specified in connection string Message-ID: <20200902131858.GD13613@momjian.us> References: <16486-b9c93d71c02c4907@postgresql.org> <2090524.1591652199@sss.pgh.pa.us> <2110959.1591655226@sss.pgh.pa.us> <2142411.1591667958@sss.pgh.pa.us> <20200901203846.GA13613@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Sep 2, 2020 at 09:54:37AM +0200, Oleksandr Shulgin wrote: > On Tue, Sep 1, 2020 at 10:38 PM Bruce Momjian wrote: > > > I used a later version of Tom's patch to add documentation of how > connection strings can override command-line options, plus it has the > password description improvements. > > I would like to apply this to all supported versions. > > > Not related to the proposed change, this sentence is the same before and after, > but makes me wonder: > > > However, psql >         will waste a connection attempt finding out that the server wants a >         password.  In some cases it is worth typing to > avoid >         the extra connection attempt. > > AFAIK, there is nothing in the protocol that forces psql to make an extra > connection attempt.  If libpq provided a means to pass a password-prompt > callback, no extra connection would be needed I think? That is true. I don't think we want the backend to be kept open waiting for someone to type a password, which is why, I think, we don't do it that way. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee