Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

Поиск
Список
Период
Сортировка
От jian he
Тема Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
Дата
Msg-id CACJufxGC7pZsJFBkU1mUG8vdGGoRQh8otiZkA0aC7bULktBosw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints  (Rushabh Lathia <rushabh.lathia@gmail.com>)
Ответы Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
Список pgsql-hackers
hi.

CREATE TABLE t (a int, b int);
INSERT INTO t VALUES (NULL, 1), (300, 3);
ALTER TABLE t ADD CONSTRAINT nn NOT NULL a NOT VALID; -- ok
ALTER TABLE t add column c float8 default random();
the last query should not fail.


if we want more places use CompactAttribute->attnullability
set_attnotnull should also set CompactAttribute->attnullability proactively
not waiting CommandCounterIncrement invoke RelationBuildTupleDesc.

another reason:
CheckNNConstraintFetch only handle "if (!conform->convalidated)"
what if the not-null is set conform->convalidated to true,
then RelationBuildTupleDesc doesn't set/change
CompactAttribute->attnullability at all.


attached is all the needed changes after v8-0001, v8-0002, i think.

Вложения

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