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 1oQiCT-0006qt-VX for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Aug 2022 04:41:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oQiCP-0000SG-KN for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Aug 2022 04:41:05 +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 1oQiCP-0000S7-B4 for pgsql-hackers@lists.postgresql.org; Wed, 24 Aug 2022 04:41:05 +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 1oQiCN-0008JD-Bz for pgsql-hackers@postgresql.org; Wed, 24 Aug 2022 04:41:04 +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 27O4esTN903553; Wed, 24 Aug 2022 00:40:54 -0400 From: Tom Lane To: Michael Paquier cc: Jacob Champion , "Drouvot, Bertrand" , Joe Conway , Robert Haas , "sfrost@snowman.net" , "rjuju123@gmail.com" , "pgsql-hackers@postgresql.org" , "andres@anarazel.de" Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers In-reply-to: References: <127bd019-04f0-313c-551c-d949cdc4ad50@amazon.com> <520bd3ce-334b-b9c2-2130-858fb04ce56f@amazon.com> <2541c086-e370-d114-69a7-b48b05b25471@amazon.com> Comments: In-reply-to Michael Paquier message dated "Wed, 24 Aug 2022 13:06:01 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <903551.1661316054.1@sss.pgh.pa.us> Date: Wed, 24 Aug 2022 00:40:54 -0400 Message-ID: <903552.1661316054@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, Aug 23, 2022 at 10:04:30AM -0700, Jacob Champion wrote: >> When can we rely on static initialization, and when can't we? Is there a >> concern that the memory could have been polluted from before the >> postmaster's fork? > My main worry here is EXEC_BACKEND, where we would just use our own > implementation of fork(), and it is a bad idea at the end to leave > that untouched while we could have code paths that attempt to access > it. Uh ... what? EXEC_BACKEND is even more certain to correctly initialize static/global variables in a child process. I agree with Jacob that this memset is probably useless, and therefore confusing. regards, tom lane