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.96) (envelope-from ) id 1wT0I8-000Ffw-2T for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2026 16:42:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wT0I7-003WfR-0F for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2026 16:42:35 +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.96) (envelope-from ) id 1wT0I6-003WfJ-2X for pgsql-hackers@lists.postgresql.org; Fri, 29 May 2026 16:42:35 +0000 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wT0I4-00000000Ab2-1uWJ for pgsql-hackers@postgresql.org; Fri, 29 May 2026 16:42:34 +0000 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-479dd56d016so10679576b6e.3 for ; Fri, 29 May 2026 09:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780072950; x=1780677750; darn=postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=p9zYbCIgFUPT3leORxenaJG0bll3htx6b55Ba4jL6g4=; b=mPSMDAmezYv7RqG0APmsj0deInfPX6yHAHQbZ7dEafzYj3FeFEREMguVqzCPU3wahn rzcmjT/2GxZcHOloiIg43y/WmT+Pwo3CeHraDsr262UimGXeQmH9y97HJAfB11kqOlHU Tdq8j/licnUbp8Td+HHiDDbJWM7oJ5FvbjyFEC+p6BB0MAA8+OjC/u1nHCIK47TpOSo8 91jweHin7/CVDEArP0/Vwm1T67Jtl7JIoht00oZk22OoZ8e4j+RdzpjxpLZVuwR8ieq5 qNnmb5b6eM9VlNPBWfPLaecUaq/RJATmY/2eWtaRoKG9d/yNrN8TasHPkhe/+olStR+b xdLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780072950; x=1780677750; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=p9zYbCIgFUPT3leORxenaJG0bll3htx6b55Ba4jL6g4=; b=TyY0htwxMoDdz7zzMHszVA+xQT5apweJE1cmSOATlX8vbrQ54QSAeRjynWF0wnHOkj 24WMdUuj8if4lSX/VRfXuWwt2E5jO1W/WplAsVpqQ5jEUXzZ19WXkrQjxHq8btcCtIf3 3/Ix3wn5LU/v//+arjUWyBsRq2s1QDUC5sZPGCUMRMsnAZ02+Ttt76Cz6J2w07r6woj5 2pPc5ziWybGdzUTcT2AOatYn0sBFb7MaBbca1bFd2+HfCBiBjRYiUPx9uqGnMO9jOVcV kLrYilCmjMprrL+oKlYe/2KQraBfqAM4VI+TsEVIQooyRR/0EZuV/y0E4v5+Z1tWmBK8 C2pA== X-Gm-Message-State: AOJu0Yx1mlM/OIVc9wr+fTaY4jjRsZ5u25CCt2efy/itD3wFNaXGMXjZ zglKQHLTp01212MVkRz3OuvuQD27WlqGcO6jtrGWjSEO+VV32jl8kbos4uGImQ== X-Gm-Gg: Acq92OF9DwZ3s82PVws4S0brJln8byjpLUCEQC/6QIFwwIMJShgGWGjMjnlbFEi3QD7 uWCm+cOd/DFPLLth7xJ2r/P6FPaNmu+6TzsBZ0vamHWxBvnK1tC+DV/daPVFSt8k61HuGL31buK PChByU5S3ynbVAxpvK5g7auVEKXEpdCxhjn0aHLrQeSwEF/4uWXNPu//YYwi41WjGiE1/QCBLOJ Sa5sQCWq6K5xYC5ku1i7sTNaCUsIP1Be/aUAJnKtvv0mUn4YuMgH96C/th/9xYKu+Lh0qCDpP3U Wr62Q1YoGGKc6T5XkKXKh32Qii2doS/1jv1+yeZDfyjy0YMb2D1LcMJCBlPd1T1/5tgpsD1on0m c9b9ZHl6RUukn4y3jO7FZkPGT6M2FH85pKXajs8DFA/0P5craAJCg6vw8t/r38EK9sM7Htwb9kp nR5qnOjKws40tdz09/MEtawz6cO9pNV171d9dSZu9j8ZNnuq8i46v9o4Yu4LfPrjum1CRvN81Wx 3Yn+Yhwqk1bLrAyxN89uKRzJmetDY6N X-Received: by 2002:a05:6808:c1cb:b0:482:e9e4:9da with SMTP id 5614622812f47-485fbb5686cmr79111b6e.42.1780072950132; Fri, 29 May 2026 09:42:30 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 5614622812f47-485edbc33d9sm930810b6e.3.2026.05.29.09.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2026 09:42:29 -0700 (PDT) Date: Fri, 29 May 2026 11:42:27 -0500 From: Nathan Bossart To: Jacob Champion Cc: pgsql-hackers@postgresql.org Subject: Re: future of PQfn() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk For future reference in the archives, I'm moving the discussion about 0001 (the prepared statement deallocation notification mechanism) to a new thread: https://postgr.es/m/ahm_4eOKkkKJ3Gds%40nathan On Fri, May 29, 2026 at 09:33:03AM -0700, Jacob Champion wrote: > On Fri, May 29, 2026 at 9:11 AM Nathan Bossart wrote: >> I'm certainly open to other ideas, but I'm afraid this is the best I've >> come up with in my admittedly limited time thinking about the problem. > > No worries -- I hadn't meant to block progress here on protocol > design. I think keeping PQnfn() for the immediate future is a good > plan. I just wanted to plant a seed for getting away from this problem > eventually. > > (As for pie-in-the-sky alternative ideas, the ability for middleware > to separate contexts or streams of packets has come up before. libpq > could theoretically mark its own "context" of server-side allocations > that are not touched by an application-context DISCARD.) Along these lines, I did consider "pinning" statements or even having "built-in" ones for libpq. I didn't like the "pinning" idea because that seemed problematic for connection poolers. And the "built-in" idea seemed too libpq-centric for what I'd argue is a general problem. The other ideas involved guessing at what's happening based on the queries or somehow trying to handle failures due to missing/wrong prepared statements, none of which felt viable. -- nathan