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 1nUygq-0003CI-51 for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Mar 2022 22:33:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nUygo-0005DO-RJ for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Mar 2022 22:33:50 +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 1nUygo-0005DF-Hx for pgsql-hackers@lists.postgresql.org; Thu, 17 Mar 2022 22:33:50 +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 1nUygi-0005wD-9D for pgsql-hackers@postgresql.org; Thu, 17 Mar 2022 22:33:50 +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 22HMXc6C973626; Thu, 17 Mar 2022 18:33:38 -0400 From: Tom Lane To: Jacob Champion cc: "michael@paquier.xyz" , "rjuju123@gmail.com" , "pgsql-hackers@postgresql.org" , "andres@anarazel.de" , "sfrost@snowman.net" Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers In-reply-to: References: <20220225212349.gf76klktl4dmm5ah@alap3.anarazel.de> <0cead4e58257beebb96f162507151271ff2f7b54.camel@vmware.com> <20220228210036.GN10577@tamriel.snowman.net> <20220301133527.GS10577@tamriel.snowman.net> <20220302212740.krbycl3nzvp5y2k5@alap3.anarazel.de> Comments: In-reply-to Jacob Champion message dated "Thu, 17 Mar 2022 22:02:16 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <973624.1647556418.1@sss.pgh.pa.us> Date: Thu, 17 Mar 2022 18:33:38 -0400 Message-ID: <973625.1647556418@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jacob Champion writes: > On Fri, 2022-03-04 at 10:45 +0900, Michael Paquier wrote: >> At the end of the day, Port is an interface used for the communication >> between the postmaster with the frontends, so I'd like to say that it >> is correct to not apply this concept to parallel workers because they >> are not designed to contact any frontend-side things. > Coming back to this late, sorry. I'm not quite sure where to move with > this. I'm considering copying pieces of Port over just so we can see > what it looks like in practice? > Personally I think it makes sense for the parallel workers to have the > authn information for the client -- in fact there's a lot of > information that it seems shouldn't be hidden from them -- but there > are other pieces, like the socket handle, that are clearly not useful. Yeah. It seems to me that putting the auth info into struct Port was a fairly random thing to do in the first place, and we are now dealing with the fallout of that. I think what we ought to do here is separate out the data that we think parallel workers need access to. It does not seem wise to say "workers can access fields A,B,C of MyPort but not fields X,Y,Z". I do not have a concrete proposal for fixing it though. regards, tom lane