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

From Peter Eisentraut
Subject Re: Catalog domain not-null constraints
Date
Msg-id 99adc944-bcc1-41bb-ae59-a10fb345f5dc@eisentraut.org
Whole thread Raw
In response to Re: Catalog domain not-null constraints  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On 23.11.23 17:38, Alvaro Herrera wrote:
> If you create a table with column of domain that has a NOT NULL
> constraint, what happens?  I mean, is the table column marked
> attnotnull, and how does it behave?

No, the domain does not affect the catalog entry for the column.  This 
is the same way it behaves now.

> Is there a separate pg_constraint
> row for the constraint in the table?  What happens if you do
> ALTER TABLE ... DROP NOT NULL for that column?

Those are separate.  After dropping the NOT NULL for a column, null 
values for the column could still be rejected by a domain.  (This is the 
same way CHECK constraints work.)




pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: Improve rowcount estimate for UNNEST(column)
Next
From: "Drouvot, Bertrand"
Date:
Subject: Re: [PATCH] pg_convert improvement