From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix ALTER TABLE / INHERIT with generated columns
Date: Tue, 04 May 2021 10:23:41 +0000
Message-ID: <E1ldsDN-0006tG-G8@gemulon.postgresql.org> (raw)
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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a970edbed306354b0079bdcdc2fc74312122ad89
Modified Files
--------------
src/backend/commands/tablecmds.c | 60 +++++++++++++++++++++++++++++++++
src/test/regress/expected/generated.out | 21 ++++++++++++
src/test/regress/sql/generated.sql | 14 ++++++++
3 files changed, 95 insertions(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org
Subject: Re: pgsql: Fix ALTER TABLE / INHERIT with generated columns
In-Reply-To: <E1ldsDN-0006tG-G8@gemulon.postgresql.org>
References: <E1ldsDN-0006tG-G8@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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