aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-02-06 15:17:02 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-02-06 15:17:02 -0500
commit580069037cec005ed3b61d233ae87462be91c6d0 (patch)
tree7b1c0cd99a385bef504b516b16fdd8712f56fb22 /src/backend/executor
parentd9b4163c553eb8ae47034946c11efb04e9498f6f (diff)
downloadpostgresql-580069037cec005ed3b61d233ae87462be91c6d0.tar.gz
postgresql-580069037cec005ed3b61d233ae87462be91c6d0.zip
Disallow converting an inheritance child table to a view.
Generally, members of inheritance trees must be plain tables (or, in more recent versions, foreign tables). ALTER TABLE INHERIT rejects creating an inheritance relationship that has a view at either end. When DefineQueryRewrite attempts to convert a relation to a view, it already had checks prohibiting doing so for partitioning parents or children as well as traditional-inheritance parents ... but it neglected to check that a traditional-inheritance child wasn't being converted. Since the planner assumes that any inheritance child is a table, this led to making plans that tried to do a physical scan on a view, causing failures (or even crashes, in recent versions). One could imagine trying to support such a case by expanding the view normally, but since the rewriter runs before the planner does inheritance expansion, it would take some very fundamental refactoring to make that possible. There are probably a lot of other parts of the system that don't cope well with such a situation, too. For now, just forbid it. Per bug #16856 from Yang Lin. Back-patch to all supported branches. (In versions before v10, this includes back-patching the portion of commit 501ed02cf that added has_superclass(). Perhaps the lack of that infrastructure partially explains the missing check.) Discussion: https://postgr.es/m/16856-0363e05c6e1612fd@postgresql.org
Diffstat (limited to 'src/backend/executor')
0 files changed, 0 insertions, 0 deletions