From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Guard against table-AM-less relations in planner. |
Date: | 2022-10-17 15:35:40 |
Message-ID: | E1okS9T-002mdS-Iu@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Guard against table-AM-less relations in planner.
The executor will dump core if it's asked to execute a seqscan on
a relation having no table AM, such as a view. While that shouldn't
really happen, it's possible to get there via catalog corruption,
such as a missing ON SELECT rule. It seems worth installing a defense
against that. There are multiple plausible places for such a defense,
but I picked the planner's get_relation_info().
Per discussion of bug #17646 from Kui Liu. Back-patch to v12 where
the tableam APIs were introduced; in older versions you won't get a
SIGSEGV, so it seems less pressing.
Discussion: https://postgr.es/m/17646-70c93cfa40365776@postgresql.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/eec34661182db7b79a6b56c551ac1d79ef3e1f89
Modified Files
--------------
src/backend/optimizer/util/plancat.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2022-10-17 16:14:54 | pgsql: Reject non-ON-SELECT rules that are named "_RETURN". |
Previous Message | Michael Paquier | 2022-10-17 02:40:36 | pgsql: Fix calculation related to temporary WAL segment name in basic_a |