| From: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
|---|---|
| To: | pgsql-hackers(at)postgresql(dot)org |
| Subject: | future of PQfn() |
| Date: | 2026-05-26 16:05:47 |
| Message-ID: | ahXE28klgxIJXBLq@nathan |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Paul A Jungwirth | 2026-05-26 16:14:04 | Re: Fix bug of UPDATE/DELETE FOR PORTION OF with inheritance tables |
| Previous Message | Mats Kindahl | 2026-05-26 16:03:32 | Re: pg_rewind does not rewind diverging timelines |