[COMMITTERS] pgsql: Apply ALTER ... SET NOT NULL recursively in ALTER ... ADDPRIMAR

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Apply ALTER ... SET NOT NULL recursively in ALTER ... ADDPRIMAR
Дата
Msg-id E1ddemy-0005uN-0a@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Apply ALTER ... SET NOT NULL recursively in ALTER ... ADD PRIMARY KEY.

If you do ALTER COLUMN SET NOT NULL against an inheritance parent table,
it will recurse to mark all the child columns as NOT NULL as well.  This
is necessary for consistency: if the column is labeled NOT NULL then
reading it should never produce nulls.

However, that didn't happen in the case where ALTER ... ADD PRIMARY KEY
marks a target column NOT NULL that wasn't before.  That was questionable
from the beginning, and now Tushar Ahuja points out that it can lead to
dump/restore failures in some cases.  So let's make that case recurse too.

Although this is meant to fix a bug, it's enough of a behavioral change
that I'm pretty hesitant to back-patch, especially in view of the lack
of similar field complaints.  It doesn't seem to be too late to put it
into v10 though.

Michael Paquier, editorialized on slightly by me

Discussion: https://postgr.es/m/b8794d6a-38f0-9d7c-ad4b-e85adf860fc9@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c30f1770a93db1492755934048656ea809c1f569

Modified Files
--------------
src/backend/catalog/index.c               | 9 ++++-----
src/test/regress/expected/alter_table.out | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: [COMMITTERS] pgsql: Disallow SSL session tickets.
Следующее
От: Robert Haas
Дата:
Сообщение: [COMMITTERS] pgsql: hash: Increase the number of possible overflow bitmaps by 8x.