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

From Alvaro Herrera
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id 1345127470-sup-2641@alvh.no-ip.org
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: cataloguing NOT NULL constraints
List pgsql-hackers
Excerpts from Kevin Grittner's message of jue ago 02 10:48:02 -0400 2012:
>
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> wrote:
>
> > Don't forget the peculiarities of columns with record types.
>
> I forgot to include the type creation in the example:
>
> test=# create type a as (a1 int, a2 int);
> CREATE TYPE

Thanks for the example.  After playing with this, 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?

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.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Statistics and selectivity estimation for ranges
Next
From: Tom Lane
Date:
Subject: Re: UNION ALL with WHERE clause does not use Merge Append