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

From Tom Lane
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id 335175.1663596532@sss.pgh.pa.us
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  (Isaac Morland <isaac.morland@gmail.com>)
List pgsql-hackers
Isaac Morland <isaac.morland@gmail.com> writes:
> I thought I saw some discussion about the SQL standard saying that there is
> a difference between putting NOT NULL in a column definition, and CHECK
> (column_name NOT NULL). So if we're going to take this seriously, I think
> that means there needs to be a field in pg_constraint which identifies
> whether a constraint is a "real" one created explicitly as a constraint, or
> if it is just one created because a field is marked NOT NULL.

If we're going to go that way, I think that we should take the further
step of making not-null constraints be their own contype rather than
an artificially generated CHECK.  The bloat in pg_constraint from CHECK
expressions made this way seems like an additional reason not to like
doing it like that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Tree-walker callbacks vs -Wdeprecated-non-prototype
Next
From: Matthias van de Meent
Date:
Subject: Re: cataloguing NOT NULL constraints