pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Disallow ALTER TABLE ONLY / DROP EXPRESSION
Date: Tue, 03 Nov 2020 14:50:54 +0000
Message-ID: <E1kZxeA-0003tq-OA@gemulon.postgresql.org> (raw)

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(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1kZxeA-0003tq-OA@gemulon.postgresql.org>
Permalink:  ../E1kZxeA-0003tq-OA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kZxeA-0003tq-OA@gemulon.postgresql.org

 · 

reply

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: Disallow ALTER TABLE ONLY / DROP EXPRESSION
  In-Reply-To: <E1kZxeA-0003tq-OA@gemulon.postgresql.org>
  References: <E1kZxeA-0003tq-OA@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