Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
Date
Msg-id f3eaea9d-f90f-4c86-9df1-f8b549732f9b@eisentraut.org
Whole thread Raw
In response to Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
List pgsql-hackers
It occurred to me that we will also want to have NOT NULL NOT ENFORCED 
constraints eventually.  As we have discussed elsewhere, the NOT 
ENFORCED state is closely related to the NOT VALID state.  So that 
should probably be considered in the design here.

Reading up on this again now, I'm confused about putting the NOT VALID 
state for not-null constraints into pg_attribute.  We have catalogued 
not-null constraints now, so we can put metadata for them into 
pg_constraint!  And we have NOT VALID and NOT ENFORCED flags in 
pg_constraint already.

So what is the purpose of the attnotnullvalid field?  In the latest 
posted patch, I don't see this column used in the executor for the 
actual constraint checking.  So is this all merely for clients to 
understand the constraint metadata?  If we add more metadata for 
not-null constraints, do we need to add a new pg_attribute flag for each 
one?  That doesn't seem right.




pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: duplicated comments on get_relation_constraints
Next
From: Alvaro Herrera
Date:
Subject: Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints