Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXXzC-0006uj-3X for pgsql-bugs@arkaria.postgresql.org; Sun, 02 Jun 2019 21:25:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hXXzA-0006LR-Hx for pgsql-bugs@arkaria.postgresql.org; Sun, 02 Jun 2019 21:25:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXXzA-0006L8-6y for pgsql-bugs@lists.postgresql.org; Sun, 02 Jun 2019 21:25:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXXz7-0007Fq-FE for pgsql-bugs@lists.postgresql.org; Sun, 02 Jun 2019 21:25:46 +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 x52LOZ0U022336; Sun, 2 Jun 2019 17:24:35 -0400 From: Tom Lane To: Peter Billen cc: pgsql-bugs@lists.postgresql.org Subject: Re: psql should re-read connection variables after connection reset In-reply-to: References: Comments: In-reply-to Peter Billen message dated "Tue, 28 May 2019 11:56:03 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22334.1559510675.1@sss.pgh.pa.us> Date: Sun, 02 Jun 2019 17:24:35 -0400 Message-ID: <22335.1559510675@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Billen writes: > After a connection reset, psql should re-read the connection variables. > This was was initially reported by ysch on IRC and confirmed in the code by > Zr40. All I'm doing here is making sure that it is reported, as per ysch's > request. > I quickly verified this as following: > 1. start 11 instance > 2. psql into it > 3. stop 11 instance > 4. start 10 instance > 5. in the existing psql session, first trigger a reconnect ('select 1') > and then '\df', which depends on the server version. I got: Hm. I'm not entirely convinced that that needs to be a supported situation. However, it is a bit odd that CheckConnection is willing to do UnsyncVariables in one code path but not SyncVariables in the other. I wonder whether we should also do connection_warnings(false) in this code path. That could be annoyingly chatty on SSL or GSS connections, though. It's too bad that printSSLInfo and printGSSInfo don't have any notion like "print only if different from before". More, I can think of cases where they're not chatty enough: if before you had an SSL-encrypted connection, and now you don't, that seems like something you might wish to know about. regards, tom lane