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 1lqoAj-0003vJ-5L for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jun 2021 02:42: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 1lqoAh-00060b-Sv for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jun 2021 02:42:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqoAh-00060S-LM for pgsql-hackers@lists.postgresql.org; Wed, 09 Jun 2021 02:42:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqoAb-00077o-FT for pgsql-hackers@postgresql.org; Wed, 09 Jun 2021 02:42:22 +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 1592g8qB1261967; Tue, 8 Jun 2021 22:42:08 -0400 From: Tom Lane To: Michael Paquier cc: Justin Pryzby , Hubert Zhang , tsunakawa.takay@fujitsu.com, pgsql-hackers@postgresql.org, Andreas Seltenreich , Bruce Momjian Subject: Re: Multiple hosts in connection string failed to failover in non-hot standby mode In-reply-to: References: <2566986.1622468180@sss.pgh.pa.us> <2732890.1622509658@sss.pgh.pa.us> <744012.1623014869@sss.pgh.pa.us> <869606.1623076683@sss.pgh.pa.us> <1086565.1623165694@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Wed, 09 Jun 2021 10:52:10 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1261965.1623206528.1@sss.pgh.pa.us> Date: Tue, 08 Jun 2021 22:42:08 -0400 Message-ID: <1261966.1623206528@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > On Tue, Jun 08, 2021 at 11:21:34AM -0400, Tom Lane wrote: >> IIUC, what you are proposing to do is replace pgwin32_setenv with >> src/port/setenv.c. I don't think that's an improvement. setenv.c >> leaks memory on repeat calls, because it cannot know what >> pgwin32_setenv knows about how putenv works on that platform. > Is gaur the only animal that needs this file, by the way? I think it is. setenv has been in POSIX for awhile, so probably only very old systems would need that. (This is why I don't care that much that setenv.c leaks memory. But we can't start using it on platforms where we *do* care about performance.) >> (3) Don't try to use the environment variable for this >> purpose. I'd originally tried to change test5.pgc to just >> specify gssmode=disable in-line, but that only works >> nicely for one of the two failing cases. The other one >> is testing the case of a completely defaulted connection >> target, so there's no place to add an option without >> breaking the only unique aspect of that test case. > FWIW, I'd be rather in favor of doing (3) because this remains simple > just to take care of an edge case, even if that partially breaks the > promise to rely on a default connection. Yeah, it doesn't seem like we need to test that case all that badly. I'd be okay with dropping that test; or maybe we could fix things so that the default case succeeds? regards, tom lane