| From: | Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Peter Eisentraut <peter(at)eisentraut(dot)org>, Aleksander Alekseev <aleksander(at)tigerdata(dot)com>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: [PATCH] Fix null pointer dereference in PG19 |
| Date: | 2026-07-08 16:48:08 |
| Message-ID: | CA+renyV1WUtDSOHpNVv3fhD6JqhzZY_mV-0Nks23MczXLxpE8A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, Jul 7, 2026 at 7:07 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com> writes:
> > On Tue, Apr 21, 2026 at 8:24 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> Checking this at parse time is completely the wrong thing.
> >> The view could have gained (or lost) triggers by the time
> >> it's executed.
>
> > But INSTEAD OF triggers are selected in the rewriter, which uses the
> > same relcache snapshot as parse analysis. And a concurrent change
> > can't sneak in different triggers, because that causes a relcache
> > invalidation, so we redo the parse & rewrite phases.
>
> You have forgotten about views and rewrite rules. Those go to disk in
> post-parser form, and will be rewritten only at execution sometime
> later, *without* a re-parse.
Ah yes, thank you! I should have been able to work that out.
Here is another patch series. No code changes, but I inserted a new
patch with tests showing that parse-time checking crashes, but
rewrite-time and exec-time checking catches the forbidden statement.
So the series is:
v1: parse-time check, tests pass
v2: add tests that crash the server
v3: rewrite-time check: tests pass
v4: exec-time check: tests pass
These are against REL_19_STABLE, not master (but I don't think it
makes a difference).
Yours,
--
Paul ~{:-)
pj(at)illuminatedcomputing(dot)com
| Attachment | Content-Type | Size |
|---|---|---|
| v8-0003-Check-FOR-PORTION-OF-against-INSTEAD-OF-triggers-.patch | text/x-patch | 4.3 KB |
| v8-0001-Forbid-FOR-PORTION-OF-on-views-with-INSTEAD-OF-tr.patch | text/x-patch | 5.6 KB |
| v8-0004-Check-FOR-PORTION-OF-against-INSTEAD-OF-triggers-.patch | text/x-patch | 5.3 KB |
| v8-0002-Add-tests-for-FOR-PORTION-OF-reaching-INSTEAD-OF-.patch | text/x-patch | 5.5 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Siddharth Kothari | 2026-07-08 16:52:51 | Re: [PATCH] Add RetrieveInstrumentation hook for CustomScan providers |
| Previous Message | Chao Li | 2026-07-08 16:48:02 | Re: Small patch to improve safety of utf8_to_unicode(). |