Re: Catalog domain not-null constraints

Поиск
Список
Период
Сортировка
От Isaac Morland
Тема Re: Catalog domain not-null constraints
Дата
Msg-id CAMsGm5c+P49WOoh8UqOcb6Wf6j6uk9k8CojEPe4eVa4OVNQuWg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Catalog domain not-null constraints  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, 21 Mar 2024 at 10:30, Tom Lane <tgl@sss.pgh.pa.us> wrote:
 
The SQL spec's answer to that conundrum appears to be "NULL is
a valid value of every domain, and if you don't like it, tough".

To be fair, NULL is a valid value of every type. Even VOID has NULL.

In this context, it’s a bit weird to be able to decree up front when defining a type that no table column of that type, anywhere, may ever contain a NULL. It would be nice if there was a way to reverse the default so that if you (almost or) never want NULLs anywhere that’s what you get without saying "NOT NULL" all over the place, and instead just specify "NULLABLE" (or something) where you want. But that effectively means optionally changing the behaviour of CREATE TABLE and ALTER TABLE.

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

Предыдущее
От: David Christensen
Дата:
Сообщение: Re: Adding comments to help understand psql hidden queries
Следующее
От: "Pankaj Raghav (Samsung)"
Дата:
Сообщение: Large block sizes support in Linux