Re: how to create a non-inherited CHECK constraint in CREATE TABLE - Mailing list pgsql-hackers

From Noah Misch
Subject Re: how to create a non-inherited CHECK constraint in CREATE TABLE
Date
Msg-id 20120415201535.GA22182@tornado.leadboat.com
Whole thread Raw
In response to Re: how to create a non-inherited CHECK constraint in CREATE TABLE  (Nikhil Sontakke <nikkhils@gmail.com>)
Responses Re: how to create a non-inherited CHECK constraint in CREATE TABLE  (Nikhil Sontakke <nikkhils@gmail.com>)
List pgsql-hackers
On Thu, Apr 12, 2012 at 10:50:31AM +0530, Nikhil Sontakke wrote:
> > > CHECK NO INHERIT sounds fine to me; will that display ALTER TABLE ONLY
> > > x as the one true way of doing this?
> >
> > s/display/displace/, I think you meant?  Yeah, that's what I understand
> > the proposal to be.

+1 for that proposal.

> Displace yes. It would error out if someone says
> 
> ALTER TABLE ONLY... CHECK ();
> 
> suggesting to use the ONLY with the CHECK.

I'd say the behavior for that case can revert to the PostgreSQL 9.1 behavior.
If the table has children, raise an error.  Otherwise, add an inheritable
CHECK constraint, albeit one lacking inheritors at that moment.

Thanks,
nm


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Last gasp
Next
From: Greg Smith
Date:
Subject: Re: Last gasp