Re: how to create a non-inherited CHECK constraint in CREATE TABLE

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: how to create a non-inherited CHECK constraint in CREATE TABLE
Дата
Msg-id 20120415201535.GA22182@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: how to create a non-inherited CHECK constraint in CREATE TABLE  (Nikhil Sontakke <nikkhils@gmail.com>)
Ответы Re: how to create a non-inherited CHECK constraint in CREATE TABLE  (Nikhil Sontakke <nikkhils@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Last gasp
Следующее
От: Greg Smith
Дата:
Сообщение: Re: Last gasp