Re: Doc: fix the rewrite condition when executing ALTER TABLE ADD COLUMN

From: Robert Treat <rob(at)xzilla(dot)net>
To: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Doc: fix the rewrite condition when executing ALTER TABLE ADD COLUMN
Date: 2025-01-02 16:25:28
Message-ID: CABV9wwNvB3CZVehOP=3SC44m_B4W_Nbd40LBcuQzTR1vjrq2xg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 3, 2024 at 3:13 AM Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com> wrote:
>
> Hi,
>
> The documentation seems to overlook the rewrite condition
> when executing ALTER TABLE ADD COLUMN.
>
> The current document states that a volatile DEFAULT will
> trigger a rewrite of the table and its indexes. However, the
> table and its indexes will also be rewritten when an IDENTITY
> column is added, or when a column with a domain data type that
> has constraints is added.
>
> What do you think?
>

We still see a number of people asking (or confused) about table
rewrites when adding columns, so I think the initial tip should
remain, though I think it can be cleaned up a little.

In the second section (alter_table.sgml) I liked the idea of adding
these additional examples, though I tweaked the wording a bit to
(hopefully) make it a little easier to read.

Modified patch attached.

Robert Treat
https://xzilla.net

Attachment Content-Type Size
v2-0001-Doc-fix-the-rewrite-condition-when-executing-ALTE.patch application/octet-stream 4.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2025-01-02 16:37:27 Further _bt_first simplifications for parallel index scans
Previous Message Kirill Reshke 2025-01-02 16:16:05 Re: read stream on amcheck