Re: Can't find not null constraint, but \d+ shows that

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Can't find not null constraint, but \d+ shows that
Дата
Msg-id 202404110910.dbwfcz47kpth@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Can't find not null constraint, but \d+ shows that  (jian he <jian.universality@gmail.com>)
Ответы Re: Can't find not null constraint, but \d+ shows that
Список pgsql-hackers
On 2024-Apr-11, jian he wrote:

> now I figured out that
> dropping a column of primary key columns will not change other key
> columns'  "not null" property.
> dropping the primary key associated constraint will make all key
> columns "not null" property disappear.

Well, I think you were right that we should try to handle the situation
of unmarking attnotnull as much as possible, to decrease the chances
that the problematic situation occurs.  That means, we can use the
earlier code to handle DROP COLUMN when it causes a PK to be dropped --
even though we still need to handle the situation of an attnotnull flag
set with no pg_constraint row.  I mean, we still have to handle DROP
DOMAIN correctly (and there might be other cases that I haven't thought
about) ... but surely this is a much less common situation than the one
you reported.  So I'll merge everything and post an updated patch.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
Bob [Floyd] used to say that he was planning to get a Ph.D. by the "green
stamp method," namely by saving envelopes addressed to him as 'Dr. Floyd'.
After collecting 500 such letters, he mused, a university somewhere in
Arizona would probably grant him a degree.              (Don Knuth)



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

Предыдущее
От: Dmitry Koval
Дата:
Сообщение: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Следующее
От: "Daniel Westermann (DWE)"
Дата:
Сообщение: [MASSMAIL]type in basebackup_incremental.c ?