From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | Kevin Grittner <kevin(dot)grittner(at)wicourts(dot)gov> |
Cc: | Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: cataloguing NOT NULL constraints |
Date: | 2012-08-16 14:35:45 |
Message-ID: | 1345127470-sup-2641@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Excerpts from Kevin Grittner's message of jue ago 02 10:48:02 -0400 2012:
>
> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2012-08-16 14:36:46 | pgsql: In docs, change a few cases of "not important" to "unimportant". |
Previous Message | Heikki Linnakangas | 2012-08-16 12:41:43 | Re: Statistics and selectivity estimation for ranges |