Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3QI4-00072S-4j for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Apr 2017 16:59:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d3QI3-0003m1-NU for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Apr 2017 16:59:43 +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 1d3QGZ-00086j-08 for pgsql-hackers@postgresql.org; Wed, 26 Apr 2017 16:58:11 +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.84_2) (envelope-from ) id 1d3QGW-0007dB-Hd for pgsql-hackers@postgresql.org; Wed, 26 Apr 2017 16:58:09 +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 v3QGvs7s007612; Wed, 26 Apr 2017 12:57:54 -0400 From: Tom Lane To: Robert Haas cc: Heikki Linnakangas , Michael Paquier , Noah Misch , Jeff Janes , Joe Conway , pgsql-hackers Subject: Re: scram and \password In-reply-to: References: <5478ab75-404f-9490-9355-dc1365ce3d7f@iki.fi> <20170410035323.GA2846583@tornado.leadboat.com> <66e776c9-e02c-3683-28df-339f7f64ea66@iki.fi> <57f8c243-2362-e7b8-4c56-e752ba6edf6c@iki.fi> Comments: In-reply-to Robert Haas message dated "Wed, 26 Apr 2017 12:38:10 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7610.1493225874.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 26 Apr 2017 12:57:54 -0400 Message-ID: <7611.1493225874@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > On Wed, Apr 26, 2017 at 6:22 AM, Heikki Linnakangas wro= te: >> * If algorithm is not given explicitly, PQencryptPasswordConn() queries >> "SHOW password_encryption", and uses that. That is documented, and it is >> also documented that it will *not* issue queries, and hence will not blo= ck, >> if the algorithm is given explicitly. That's an important property for s= ome >> applications. If you want the default behavior without blocking, query "= SHOW >> password_encryption" yourself, and pass the result as the 'algorithm'. > TBH, I'd just require the user to specify the algorithm explicitly. > Having it run SHOW on the server seems wonky. It introduces a bunch > of failure modes for ... no real benefit, I think. Yeah. Blocking is the least of your worries --- what about being in a failed transaction, for instance? However, it's not entirely true that there's no real benefit. If the client app has to specify the algorithm then client code will need extension every time we add another algorithm. Maybe that's going to happen so seldom that it's not a big deal, but it would be nice to avoid that. Would it be worth making password_encryption be GUC_REPORT so that it could be guaranteed available, without a server transaction, from any valid connection? I'm generally resistant to adding GUC_REPORT flags, but maybe this is a time for an exception. regards, tom lane --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers