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 1kDU1p-0007iS-Eb for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2020 14:46:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDU1o-0004vk-5z for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2020 14:46:24 +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 1kDU1n-0004vd-Ve for pgsql-bugs@lists.postgresql.org; Wed, 02 Sep 2020 14:46:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDU1l-00037V-Ou for pgsql-bugs@lists.postgresql.org; Wed, 02 Sep 2020 14:46:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 082EkJat317209; Wed, 2 Sep 2020 10:46:19 -0400 From: Tom Lane To: Bruce Momjian cc: Oleksandr Shulgin , "David G. Johnston" , exclusion@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #16486: Prompted password is ignored when password specified in connection string In-reply-to: <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> <20200902131858.GD13613@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Wed, 02 Sep 2020 09:18:58 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <317207.1599057979.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 02 Sep 2020 10:46:19 -0400 Message-ID: <317208.1599057979@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bruce Momjian writes: > On Wed, Sep 2, 2020 at 09:54:37AM +0200, Oleksandr Shulgin wrote: >> 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. Yeah, I think this is an ancient value judgement. Sure, it's pretty questionable whether spawning a backend a second time is better than tying one up waiting for a human to type a password. (It's going to be spending a lot of time waiting for that human later on, anyway.) The real point IMO is that libpq's connection API is already unreasonably complicated, and providing a callback of this sort would make it even messier. A different client library might make a different choice, perhaps. regards, tom lane