GENERATED STORED columns and table rewrites?

From: Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: GENERATED STORED columns and table rewrites?
Date: 2020-04-15 17:25:24
Message-ID: CAOtHd0BMw1A58d35DjWj5jScbmcoF1heGbBz_WV7kd2fU92cKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

Does adding a GENERATED STORED column need to rewrite the table (like
adding a column with a DEFAULT before 11)? Neither the ALTER TABLE docs [1]
nor the generated column docs [2] discuss this. The former has a very nice
Tip regarding DEFAULT columns--maybe we should clarify GENERATED STORED
behavior either way? It seems like a very similar issue. Experimenting with
this, \timing suggests that there is work proportional to the size of the
table, but I'd like to understand the behavior better (and other users
probably would, too).

Thanks,
Maciek

[1]:
https://www.postgresql.org/docs/current/ddl-alter.html#DDL-ALTER-ADDING-A-COLUMN
[2]: https://www.postgresql.org/docs/current/ddl-generated-columns.html

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Niels Jespersen 2020-04-15 17:50:08 timestamp and timestamptz
Previous Message Adrian Klaver 2020-04-15 14:22:58 Re: pg_basebackup && long time storage of wal_archive/ content