pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Disallow ALTER TABLE ONLY / DROP EXPRESSION 2+ messages / 1 participants [nested] [flat]
* pgsql: Disallow ALTER TABLE ONLY / DROP EXPRESSION @ 2020-11-03 14:50 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 2+ messages in thread From: Peter Eisentraut @ 2020-11-03 14:50 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow ALTER TABLE ONLY / DROP EXPRESSION The current implementation cannot handle this correctly, so just forbid it for now. GENERATED clauses must be attached to the column definition and cannot be added later like DEFAULT, so if a child table has a generation expression that the parent does not have, the child column will necessarily be an attlocal column. So to implement ALTER TABLE ONLY / DROP EXPRESSION, we'd need extra code to update attislocal of the direct child tables, somewhat similar to how DROP COLUMN does it, so that the resulting state can be properly dumped and restored. Discussion: https://www.postgresql.org/message-id/flat/15830.1575468847%40sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/bf797a8d9768239f5e3204b013044274b2c7c24a Modified Files -------------- src/backend/commands/tablecmds.c | 22 +++++++++++++++++++--- src/test/regress/expected/generated.out | 11 ++++++----- src/test/regress/sql/generated.sql | 2 +- 3 files changed, 26 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Disallow ALTER TABLE ONLY / DROP EXPRESSION @ 2020-11-03 14:50 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 2+ messages in thread From: Peter Eisentraut @ 2020-11-03 14:50 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow ALTER TABLE ONLY / DROP EXPRESSION The current implementation cannot handle this correctly, so just forbid it for now. GENERATED clauses must be attached to the column definition and cannot be added later like DEFAULT, so if a child table has a generation expression that the parent does not have, the child column will necessarily be an attlocal column. So to implement ALTER TABLE ONLY / DROP EXPRESSION, we'd need extra code to update attislocal of the direct child tables, somewhat similar to how DROP COLUMN does it, so that the resulting state can be properly dumped and restored. Discussion: https://www.postgresql.org/message-id/flat/15830.1575468847%40sss.pgh.pa.us Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/53977598174652dcb06bc2b26674c29b9ae601cc Modified Files -------------- src/backend/commands/tablecmds.c | 22 +++++++++++++++++++--- src/test/regress/expected/generated.out | 11 ++++++----- src/test/regress/sql/generated.sql | 2 +- 3 files changed, 26 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-11-03 14:50 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-11-03 14:50 pgsql: Disallow ALTER TABLE ONLY / DROP EXPRESSION Peter Eisentraut <peter@eisentraut.org> 2020-11-03 14:50 pgsql: Disallow ALTER TABLE ONLY / DROP EXPRESSION Peter Eisentraut <peter@eisentraut.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox