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 1wSznc-000FOi-1m for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2026 16:11:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wSzna-003KT2-38 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2026 16:11:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wSzna-003KSu-2G for pgsql-hackers@lists.postgresql.org; Fri, 29 May 2026 16:11:03 +0000 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wSznY-000000008yb-3k4k for pgsql-hackers@postgresql.org; Fri, 29 May 2026 16:11:02 +0000 Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-7e5fd39cf11so6809648a34.0 for ; Fri, 29 May 2026 09:11:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780071061; x=1780675861; 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=WURnvA71lXFjBmKEz/e8DwkCX/qAir+zUVonWldgb+0=; b=I7RnEMW50gNBWzbT9EgWCcuaXUzksGHHPJQzfdoEQHKMou7ttmnp8fTysj1JC9RL8s MplJCX83+1V+eRDPOPsvOilBSJ+XjpV0hPZ1j39QrFE8EzmIoIj8l9VBHHiBUcFAwGxk HHqPjMMvIjsNLUEnhRt353TNh0G1B3+Cd53n+7AL5FfGQm/ILYXZQMhZ8T2aDDTML+jc EQGbPXpcw2FrxpjQV31yGEttz5f6QDwnZmGHBQ6pEKMylPYUkU/7FInyv9GqObFJie3Q 3PGJIhJckB7vmAS/MJU6ktcixRhiEQsIfmZAzR3qMd/LiLVon/6zyDkjV0YH0ie6A/QV 86fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780071061; x=1780675861; 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=WURnvA71lXFjBmKEz/e8DwkCX/qAir+zUVonWldgb+0=; b=JDKG/2iMqOQleInRw9LGtKZP1WZ2oOIcx49L/mpT08blbKgkoldt2qcB4jIhW+bTo6 vA4A+BrsrW+33TPaFMGfQmTSCk8OhM6ArobNpXeT7tTnQ5zYV2HC5rfU4uHCVAiiaH4A ifmmPJGVxYtRub7JQF+e/B8JoKhtPRrv4rvzP1JSx1Ea+sUgE70NCdLwqzbivVt2qgDI 9ONIyHfQp1I4yNMLwpCe25pyFHNZ3nUrSXdX7LmcM1w8hwmHOLUT0mLiHi1XiTRTIRWI ASbQMIfDCQ1nHb8NSvagF6QtJGdOGVkAq0ZsHHULRdGzD+WEMrXd26brie73h0R7IGzV ai4g== X-Gm-Message-State: AOJu0Yz7ztuniJZLk3Y0fDAGEMng99Oy6/o87CvwtbLWoym2kC38VdUg sVmPN80RZkepwWYTh9SRr7SbzhqCOd0/ZlPSCJm86DDeiv/5Po7HB+64 X-Gm-Gg: Acq92OGvZmP14/M6yNloKWLb6H2ThJPwr6ll3w730mTv5ISQOGEDtoTjWVvMCDeeLlq lIvexhxxLyMCVh8zsN5j6o0rsgJdTHrmlWycnXWTo8x6PidG6QinKWj3cKYZQxuqj3Gf5GHCiUu 1yz72LP9nR+iEvEREaFrkkgeGw4KgvPxvEBzU47VQ5R4117SdFZYEcuF0UxC/VvkG6K6k1MMiZp IEk0sJW4YxIQTJAOcBAW0LMFQyiIkDd9kWgCU4/HYr27xRm/g4hLG1M/W8DIQuxjWdbTW30a1Tm zeE6gZFPHY57UVYOQbOXMo5fSMoS5TGdb50S70suOq9yhMFkzO02gbsYlK0+JnkId99EHSTM+p7 SBimS0P3DZ9RZLJUFoB+9TTnEi5Cu7Ut5eU6KsbdPOr3/ghQq+81Y9uuQ6CWeMAGFlP23F7FKse FG+3Tyx2oCkCxNkBaFkKGm6Ep/wFh3os+veDdvfNBE0r0tFb1RzCJ80mN0UDZmpFVXYvYkc8wPq zLaq5sNn+4Q20ueNeeVix8e6SrnBYBx X-Received: by 2002:a05:6830:3c8a:b0:7e6:6f9f:7449 with SMTP id 46e09a7af769-7e6a1e61617mr295386a34.23.1780071060819; Fri, 29 May 2026 09:11:00 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7e695b8f662sm1777919a34.4.2026.05.29.09.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2026 09:11:00 -0700 (PDT) Date: Fri, 29 May 2026 11:10:58 -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 On Fri, May 29, 2026 at 08:43:07AM -0700, Jacob Champion wrote: > On Fri, May 29, 2026 at 8:14 AM Nathan Bossart wrote: >> Here is a work-in-progress patch set that goes this direction. > > At a high level, I think advertising support for a single new message > needs to be done in a protocol extension rather than a minor version > bump. WFM >> This >> introduces a callback mechanism in libpq that is used to handle statement >> deallocation notifications. Older servers/clients fall back to >> PQexecParams(), which is slower, but the alternative is to leave PQnfn() >> and related code around indefinitely. > > IMO there's no hurry in getting rid of that path. If we decide to go > this direction, a fallback to PQnfn() seems like it'd fine for a few > releases; we could eventually swap to a PQexecParams() fallback and > get rid of the extra code once the older servers have aged out. That's fine with me, too. >> I'm wondering whether this new message type is general enough. For >> example, perhaps we could make an extensible message type for tracking >> various things. And I want to ensure this is useful for other clients, >> too. > > If it's just a general notification message, what does negotiating > "support" mean? Is best-effort notification okay, if the client has no > idea what a future message type means, or if the server doesn't send > the specific type of message the client is hoping for? That's what I had in mind. But if we don't have anything specific in mind that this mechanism could be extended to support, maybe we shouldn't bother. Especially if we can just add protocol extensions as necessary. > (In general, I'm kind of down on the "notify the client that X > happened" method of working around architectural issues. Maybe that's > what we need to move this specific part forward, but it doesn't feel > like a long-term solution and I don't know that we need to genericize > it without a solid set of use cases.) 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. -- nathan