postgresql/src
Nathan Bossart 5b72d0279b refint: Remove plan cache.
Presently, refint stores plans in a per-backend cache to avoid
re-preparing in each call.  This has a few problems.  For one,
check_foreign_key() embeds the new key values in its cascade-UPDATE
queries, so a cached plan reuses the values from preparation.
Also, the cache is never invalidated, so it can return stale
entries that cause other problems.  There may very well be more
bugs lurking.

We could spend a lot of time trying to address all these problems,
but this module is primarily intended as sample code, and by all
indications, it sees minimal use.  Furthermore, there is a growing
consensus for removing refint in v20.  However, since we'll need to
support it on the back-branches for a while longer, it probably
still makes sense to fix some of the more egregious bugs.

Therefore, let's just remove refint's plan cache entirely.  That
means we'll re-prepare on every call, but that seems quite unlikely
to bother anyone.  On v17 and older versions, the regression test
for triggers fails after this change, so I've borrowed pieces of
commit 8cfbdf8f4d to fix it.

Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/CAJTYsWXU%2BfhuzrEd_bnrxyGH3%2Bny8QRQC2QHf3ws6s9iki3c2Q%40mail.gmail.com
Backpatch-through: 14
2026-06-05 12:08:05 -05:00
..
backend Improve reporting of invalid weight symbols in setweight() et al. 2026-06-04 12:24:51 -04:00
bin pg_recvlogical: Honor source cluster file permissions for output files 2026-05-20 15:57:19 +09:00
common Fix off-by-one with NFC recomposition for Hangul U+11A7 (TBASE) 2026-06-05 07:50:18 +09:00
fe_utils In fmtIdEnc(), handle failure of enlargePQExpBuffer(). 2025-02-16 12:46:35 -05:00
include Prevent path traversal in pg_basebackup and pg_rewind 2026-05-11 05:13:51 -07:00
interfaces Mark PQfn() unsafe and fix overrun in frontend LO interface. 2026-05-11 05:13:51 -07:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Make plpgsql_trap test more robust and less resource-intensive. 2026-04-21 10:54:39 -04:00
port Prevent path traversal in pg_basebackup and pg_rewind 2026-05-11 05:13:51 -07:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:29:03 -04:00
test refint: Remove plan cache. 2026-06-05 12:08:05 -05:00
timezone Guard against unsafe conditions in usage of pg_strftime(). 2026-05-11 05:13:51 -07:00
tools Add timingsafe_bcmp(), for constant-time memory comparison 2026-05-11 05:13:51 -07:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Don't put library-supplied -L/-I switches before user-supplied ones. 2025-07-29 15:17:41 -04:00
Makefile.shlib Stop using "-multiply_defined suppress" on macOS. 2023-09-26 21:06:21 -04:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00