Alter table says rewrite is required for default values on 11.

Поиск
Список
Период
Сортировка
От PG Doc comments form
Тема Alter table says rewrite is required for default values on 11.
Дата
Msg-id 153905642709.4092.5299467551020533340@wrigleys.postgresql.org
обсуждение исходный текст
Список pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/ddl-alter.html
Description:

https://www.postgresql.org/account/comments/new/11/ddl-alter.html/
indicates that the table needs a rewrite when a column with a default value
is added, my understanding of the 11 changes meant that is not true any
longer.  The blog post below supports that unless the feature was disabled
in future.

https://blog.dbi-services.com/postgresql-11-instant-add-column-with-a-non-null-default-value/

The specific bit of "Tip" text is;
---
Adding a column with a default requires updating each row of the table (to
store the new column value). However, if no default is specified, PostgreSQL
is able to avoid the physical update. So if you intend to fill the column
with mostly nondefault values, it's best to add the column with no default,
insert the correct values using UPDATE, and then add any desired default as
described below.

В списке pgsql-docs по дате отправления:

Предыдущее
От: "Jonathan S. Katz"
Дата:
Сообщение: Re: Proposed HTML Documentation Styles
Следующее
От: fn ln
Дата:
Сообщение: v11: RETURN syntax for procedure