Re: [PATCH] Fix null pointer dereference in PG19
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Aleksander Alekseev <aleksander@tigerdata.com>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>,
Paul A Jungwirth <pj@illuminatedcomputing.com>
Date: 2026-04-21T15:24:50Z
Lists: pgsql-hackers
Aleksander Alekseev <aleksander@tigerdata.com> writes: > I propose fixing this by explicitly forbidding using the named > features together. See the patch. Checking this at parse time is completely the wrong thing. The view could have gained (or lost) triggers by the time it's executed. Actually, looking at it, transformForPortionOfClause is quite full of premature error checks: * I'd tend to move the anti-FDW check to execution too. It's not actively wrong, since nowadays we don't permit relations to change relkind, but it seems out of place. Also, it seems inadequate to deal with the case of a target that is a partitioned table having FDW partitions. * contain_volatile_functions_after_planning is utterly wrong to apply here. That should happen somewhere in the planner, where it'd be cheaper as well as not premature. * I'm inclined to think that pretty much all the mucking with opclasses is misplaced too: those structures are not immutable either. All of that should move to rewriting, planning, or even executor startup. regards, tom lane