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

From Peter Eisentraut
Subject Re: Catalog domain not-null constraints
Date
Msg-id 8734d87c-6aa0-4d4f-808e-f645b8489683@eisentraut.org
Whole thread Raw
In response to Re: Catalog domain not-null constraints  (jian he <jian.universality@gmail.com>)
Responses Re: Catalog domain not-null constraints
Re: Catalog domain not-null constraints
List pgsql-hackers
On 08.02.24 13:17, jian he wrote:
> I think I found a bug.
> connotnull already set to not null.
> every execution of  `alter domain connotnull add not null value ;`
> would concatenate 'NOT NULL VALUE' for the "Check" column,

I would have expected that.  Each invocation adds a new constraint.

But I see that table constraints do not work that way.  A command like 
ALTER TABLE t1 ADD NOT NULL c1 does nothing if the column already has a 
NOT NULL constraint.  I'm not sure this is correct.  At least it's not 
documented.  We should probably make the domains feature work the same 
way, but I would like to understand why it works that way first.





pgsql-hackers by date:

Previous
From: David Benjamin
Date:
Subject: [PATCH] Avoid mixing custom and OpenSSL BIO functions
Next
From: Tom Lane
Date:
Subject: Re: Catalog domain not-null constraints