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 1wRuHx-002nRO-2y for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 16:05:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRuHv-00565E-2m for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 16:05:52 +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 1wRuHv-005655-1u for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 16:05:52 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wRuHu-00000000sSY-3tVP for pgsql-hackers@postgresql.org; Tue, 26 May 2026 16:05:51 +0000 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-7dcdd23fcdfso5753654a34.3 for ; Tue, 26 May 2026 09:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779811550; x=1780416350; darn=postgresql.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=oahZJ3Aqt8YnYKP/hAVZEyJagDMQYhqMAVOAp0PfWq8=; b=C1WZAj/u8GMWuPo1IjuhLGsybkOKz/CWU/9bjDTTOfSIDD2aMIthzDP/fYON/5zbsL u+0qJ9T4h1U8JdNjj3fsH6S0JJGr58fp5R8RGjTHf2NsQm7RsEGLGFNo7HoMyr96NPr9 iB5c4qlT6GPHaYJV36OiFgchOkBe1YDuZD1D2kIbEjSQS+XlLK5n2T4gCXZwic0ZIirW Wwdjd5zLcQqkVS9vaIG4ycZTotWwTyJ6AT9AsDVUy5x3iNQM2ve+SIFWPVwn64id62e9 3kadDc7uJjSw2PDGOYAJXKJcshZKRRzOVMGCTG0Wbx1iKp6gwhQn8qj2X75GlW+xAsUx 09hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779811550; x=1780416350; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oahZJ3Aqt8YnYKP/hAVZEyJagDMQYhqMAVOAp0PfWq8=; b=V7esZCx+Xvy1VHUTsZc74HjL+0KJB/DBNjMwG3b5EaByl9OzNUp1Q+2tCLkMeFjZ8I TRMpAILnhpWQpRhiA5+LDKyAzmcNX6Wj6lN823jebHJELxc54yIfAXOEEvczgKd8gDzb im93gSGm+fWcMx41YwqOTbQprwyLQrAJOnSIXiV2PRKpASjIz6G9BDtvjLo6xiiK6O5H gNVUQYDpAyy258cR//vB49u0UDdCMi2u5wb/6+uNqMeLvDxg/0jFse0NnmYkjU+yXowC 9/plgpLTc8mLAeQPNw4ZRyEi212MBYQejkq7SZ4agxmFszIh3CsI9BIgREtKYnlSAhf2 6CMw== X-Gm-Message-State: AOJu0Yz4+7NERArj0QjRKvcf0qxfREk5LwIBoD0o/ErQ/VEvpU0ZZPJv UxSbm71z2bQ5ro8skr/DY1vcil46KldHxOg2tg6I0jy6+B6XYloABKmrsktiow== X-Gm-Gg: Acq92OHjLu8y7+G/PW99YOvm5Mq40guYDjwD5blEt/yWuVXh+XSi0wsP4YPscZLMt3M /jJQrD3HrpbK/geRXBJOW4bi3uaCaVsVuzy79thsvVrc+aVLFNORLuJmCYV2rFslyIVN3BcTqvM kE2j+y/cxH4guUVruOF1OurOnbVeoPJrP3flINOxDqJwKVHTQ5tag7mXhVgxgnP0vx/ACzYkawl Z8J5WOGtD6GI4ZPQWu9EHQ4lyne5hKFMDJQLNp9BrxKg7bYNZZMwFN4NKfdLLBw5dg9GijN5eMD mKZ9+VE2NzoDJsLyL9m/p2ArNykwrJj8YPVfk9fjEivlx7LR8PUWOYzT5kTYFEBdP0J4ztHWt5q +qSeb4AlgFt0TiG5cY2JXGh6lOJgcHYYSvvBkI9aZNwpEv1M+dqqYGnzdGHLasXFjhtPRHbgoEF lUP2P8cLn7cpSTsYjqEHqUTbkrofAtFHU1ZmtMzGPSKOzT8seDwENgmQWC5uPy29wbZSEkNNlsF tJwYEoAATzSPBjFgfDi0w== X-Received: by 2002:a05:6830:61ca:b0:7dc:4947:36a1 with SMTP id 46e09a7af769-7e5fee1a431mr11942399a34.12.1779811550207; Tue, 26 May 2026 09:05:50 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-43b63976d57sm13790236fac.9.2026.05.26.09.05.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2026 09:05:49 -0700 (PDT) Date: Tue, 26 May 2026 11:05:47 -0500 From: Nathan Bossart To: pgsql-hackers@postgresql.org Subject: future of PQfn() Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PQfn() was marked "somewhat obsolete" in commit efc3a25bb0 (2003), and was later marked "unsafe" in commit bd48114937 (2026). I looked around for third-party code that uses this interface but found none, and the only internal usage is for the frontend LO interface. As part of the latter commit, a special PQnfn() function was added for use by the fronend LO functions, but this was not exported by libpq. Given the above, I'd like to propose retiring PQfn() in v20. Since it's an exported symbol, we can't just delete the code, but we could have it unconditionally error. Assuming folks are okay with that, I'm wondering what we should do with the relevant documentation. Should we leave a stub with a note about its removal, or should we just wipe all mentions? I'm currently leaning towards leaving a note, but I could see the argument that's not even worth doing given the lack of uptake. The other question is what to do with the frontend LO code. The simplest thing we can do is to leave PQnfn() around as an internal function that is only used by this interface. Alternatively, we could take our own advice and used a prepared statement with binary transmission of params/results, but that has two key problems: 1) potential name collisions with user-created prepared statements and 2) breakage after DISCARD/DEALLOCATE, which I haven't come up with a good way to deal with. Another approach we could take is to just send the query via PQexecParams(), but a simple test (creating and unlinking 10K LOs) showed a ~41% slowdown compared to HEAD. So, I guess we'll need to keep PQnfn() around for now... Thoughts? -- nathan