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

From Alvaro Herrera
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id 1311172567-sup-1219@alvh.no-ip.org
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: cataloguing NOT NULL constraints
List pgsql-hackers
Excerpts from Peter Eisentraut's message of sáb jul 09 14:45:23 -0400 2011:
> On tor, 2011-07-07 at 17:34 -0400, Alvaro Herrera wrote:
> > The attached patch introduces pg_constraint rows for NOT NULL
> > column constraints.
> 
> The information schema views check_constraints and table_constraints
> currently make up some artificial constraint names for not-null
> constraints.  I suppose this patch removes the underlying cause for
> that, so could you look into updating the information schema as well?
> You could probably just remove the separate union branches for not null
> and adjust the contype conditions.

Fixing table_constraints is pretty trivial, just like you suggest;
already done in my private tree.

I checked the check_constraints definition in the standard and it's not
clear to me that NOT NULL constraints are supposed to be there at all.
Are NOT NULL constraints considered to be CHECK constraints too?

The fix is trivial either way: if they are not to be there we should
just remove the UNION arm that deals with them.  If they are, we do
likewise and then fix the other arm as you suggest.

Thanks for the pointer.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: lazy vxid locks, v3
Next
From: Bruce Momjian
Date:
Subject: Re: Another issue with invalid XML values