Fix ALTER TABLE / INHERIT with generated columns
Peter Eisentraut <peter@eisentraut.org>
Fix ALTER TABLE / INHERIT with generated columns When running ALTER TABLE t2 INHERIT t1, we must check that columns in t2 that correspond to a generated column in t1 are also generated and have the same generation expression. Otherwise, this would allow creating setups that a normal CREATE TABLE sequence would not allow. Discussion: https://www.postgresql.org/message-id/22de27f6-7096-8d96-4619-7b882932ca25@2ndquadrant.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/tablecmds.c | modified | +60 −0 |
| src/test/regress/expected/generated.out | modified | +21 −0 |
| src/test/regress/sql/generated.sql | modified | +14 −0 |
Discussion
- Dumping/restoring fails on inherited generated column 37 messages · 2019-12-04 → 2021-05-04