Re: [PATCH] Fix null pointer dereference in PG19 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Fix null pointer dereference in PG19
Date
Msg-id 626986.1776785090@sss.pgh.pa.us
Whole thread
In response to [PATCH] Fix null pointer dereference in PG19  (Aleksander Alekseev <aleksander@tigerdata.com>)
Responses Re: [PATCH] Fix null pointer dereference in PG19
List 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



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Next
From: Andres Freund
Date:
Subject: Re: First draft of PG 19 release notes