Re: Catalog domain not-null constraints - Mailing list pgsql-hackers

From Isaac Morland
Subject Re: Catalog domain not-null constraints
Date
Msg-id CAMsGm5c+P49WOoh8UqOcb6Wf6j6uk9k8CojEPe4eVa4OVNQuWg@mail.gmail.com
Whole thread Raw
In response to Re: Catalog domain not-null constraints  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: David Christensen
Date:
Subject: Re: Adding comments to help understand psql hidden queries
Next
From: "Pankaj Raghav (Samsung)"
Date:
Subject: Large block sizes support in Linux