Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uLB7h-002enk-IO for pgsql-hackers@arkaria.postgresql.org; Sat, 31 May 2025 01:34:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uLB7e-008LCe-DP for pgsql-hackers@arkaria.postgresql.org; Sat, 31 May 2025 01:34:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uLB7e-008LA4-3D for pgsql-hackers@lists.postgresql.org; Sat, 31 May 2025 01:34:54 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uLB7a-000yVm-33 for pgsql-hackers@lists.postgresql.org; Sat, 31 May 2025 01:34:53 +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 54V1Yloi2724613; Fri, 30 May 2025 21:34:47 -0400 From: Tom Lane To: Greg Sabino Mullane cc: Antonin Houska , "pgsql-hackers@lists.postgresql.org" Subject: Re: POC: Carefully exposing information without authentication In-reply-to: References: <21076.1748617331@localhost> Comments: In-reply-to Greg Sabino Mullane message dated "Fri, 30 May 2025 20:13:45 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2724611.1748655287.1@sss.pgh.pa.us> Date: Fri, 30 May 2025 21:34:47 -0400 Message-ID: <2724612.1748655287@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Greg Sabino Mullane writes: > Good question. Forking is expensive, and there is also a lot of > housekeeping associated with it that is simply not needed here. We want > this to be lightweight, and simple. No need to fork if we are just going to > do a few strncmp() calls and a send(). send() can block. I think calling it in the postmaster is a nonstarter. For comparison, we make an effort to not do any communication with incoming clients until after forking a child to do the communication. The one exception is if we have to report fork failure --- but we don't make any strong guarantees about that report succeeding. (IIRC, we put the port into nonblock mode and try only once.) That's probably not a behavior you want to adopt for non-edge-case usages. Another point is that you'll recall that there's a lot of interest in switching to a threaded model. The argument that "fork is too expensive" may not have a long shelf life. I'm not taking a position on whether $SUBJECT is a good idea in the first place. regards, tom lane