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

From Kevin Grittner
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id 502CD49F02000025000497A7@gw.wicourts.gov
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> I think that a NOT NULL constraint attached to a column with a
> composite type is equivalent to a CHECK (col IS DISTINCT FROM
> NULL); at least they seem to behave identically.  Is that what you
> would expect?
I had not thought about that, but now that you point it out I think
that interpretation makes more sense than any other.  In a quick
test they behaved identically for me.
> This seems a bit complicated to handle with the way I'm doing
> things today; at parse analysis time, when my current code is
> creating the check constraint, we don't know anything about the
> type of the column IIRC.  Maybe I will have to delay creating the
> constraint until execution.
Why?  CHECK (col IS DISTINCT FROM NULL) works correctly for *any*
type, doesn't it?
-Kevin



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: HeapTupleHeaderAdvanceLatestRemovedXid doing the wrong thing with multixacts
Next
From: Peter Geoghegan
Date:
Subject: Re: The pgrminclude problem