Fix stale composite type OIDs in cached PL/pgSQL expressions. When a composite type is dropped and recreated, or altered in-session, PL/pgSQL caches simple expressions whose PARAM_EXTERN nodes keep the old type OID. Reusing them then fails with "cache lookup failed for type ..." or a parameter type mismatch error. This patch refreshes record type OIDs at the type-reporting points and, before reusing a cached simple expression, checks whether any Param type no longer matches the current datum

Log in to edit
ID 7674
Title Fix stale composite type OIDs in cached PL/pgSQL expressions. When a composite type is dropped and recreated, or altered in-session, PL/pgSQL caches simple expressions whose PARAM_EXTERN nodes keep the old type OID. Reusing them then fails with "cache lookup failed for type ..." or a parameter type mismatch error. This patch refreshes record type OIDs at the type-reporting points and, before reusing a cached simple expression, checks whether any Param type no longer matches the current datum
CI (CFBot) Not processed
Stats (from CFBot) Unknown
Tags Bugfix
Created 2026-11-20 14:59:01
Last modified 2026-11-20 15:08:44 (11 minutes ago)
Latest email
Status
PG20-4 (2027-01-01 – 2027-01-31): Withdrawn
Target version 20
Authors yuan song (yssong)
Reviewers Log in to become reviewer
Committer
Links
Emails
History
When Who What
2026-11-20 15:08:44 yuan song (yssong) Detached mail thread 1b33a84a.7f77.1a1f4804e77.Coremail.yyuansong@126.com
2026-11-20 15:08:20 yuan song (yssong) Closed in commitfest PG20-4 with status: Withdrawn
2026-11-20 14:59:01 yuan song (yssong) Attached mail thread 1b33a84a.7f77.1a1f4804e77.Coremail.yyuansong@126.com
2026-11-20 14:59:01 yuan song (yssong) Created patch record
Log in to edit