Skip site navigation (1) Skip section navigation (2)

CHECK NO INHERIT syntax

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: CHECK NO INHERIT syntax
Date: 2012-07-18 21:49:37
Message-ID: 1342648177.31327.10.camel@vanquo.pezone.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Sorry to raise this once again, but I still find this CHECK NO INHERIT
syntax to a bit funny.  We are currently using something like

CHECK NO INHERIT (foo > 0)

But we already have a different syntax for attaching attributes to
constraints (NOT DEFERRABLE, NOT VALID,  etc.), so it would make more
sense to have

CHECK (foo > 0) NO INHERIT

Besides consistency, this makes more sense, because the attribute is a
property of the constraint as a whole, not of the "checking".

This would also extend more easily to other constraint types.  For
example, when unifying CHECK and NOT NULL constraints, as is planned, or
when allowing inherited unique constraints, as is planned further down
the road.

There is also a hole in the current implementation.  Domain constraints
silently allow NO INHERIT to be specified, even though other senseless
attributes are rejected.



Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2012-07-18 21:49:55
Subject: Re: bgwriter, regression tests, and default shared_buffers settings
Previous:From: Samuel VogelDate: 2012-07-18 21:48:05
Subject: Re: b-tree index search algorithms

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group