Re: cataloguing NOT NULL constraints - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id e254d0c9-d767-2420-9a9c-fd821b493acf@eisentraut.org
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
On 15.08.23 11:57, Dean Rasheed wrote:
> Something else I noticed when reading the SQL standard is that a
> user-defined CHECK (col IS NOT NULL) constraint should be recognised
> by the system as also making the column not null (setting its
> "nullability characteristic" to "known not nullable"). I think that's
> more than just an artefact of how they say NOT NULL constraints should
> be implemented, because the effect of such a CHECK constraint should
> be exposed in the "columns" view of the information schema -- the
> value of "is_nullable" should be "NO" if the column is "known not
> nullable".

Nullability determination is different from not-null constraints.  The 
nullability characteristic of a column can be derived from multiple 
sources, including not-null constraints, check constraints, primary key 
constraints, domain constraints, as well as more complex rules in case 
of views, joins, etc.  But this is all distinct and separate from the 
issue of not-null constraints that we are discussing here.



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Return value of pg_promote()
Next
From: Fabien COELHO
Date:
Subject: Re: pgbench - adding pl/pgsql versions of tests