Re: how to create a non-inherited CHECK constraint in CREATE TABLE
От | Nikhil Sontakke |
---|---|
Тема | Re: how to create a non-inherited CHECK constraint in CREATE TABLE |
Дата | |
Msg-id | CANgU5Zdqg20Wigt8vQRox7BEDe3Q96mMSZ1sqA+vQ9kSx0gxHA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: how to create a non-inherited CHECK constraint in CREATE TABLE (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: how to create a non-inherited CHECK constraint in CREATE TABLE
|
Список | pgsql-hackers |
Hi,
Cumulative reaction to all the responses first:
Whoa! :)
I was under the impression that a majority of us felt that the current mechanism was inadequate. Also if you go through the nabble thread, the fact that CREATE TABLE did not support such constraints was considered to be an annoyance. And I was enquired if/when I can provide this functionality. Apologies though with the timing.
Yeah, exactly.
Displace yes. It would error out if someone says
ALTER TABLE ONLY... CHECK ();
suggesting to use the ONLY with the CHECK.
This patch does this and also makes both CREATE TABLE and ALTER TABLE use it in a uniform manner.
Regarding "NO INHERIT" versus "ONLY", we again have had discussions on the longish original thread quite a while back:
http://postgresql.1045698.n5.nabble.com/Check-constraints-on-partition-parents-only-tt4633334.html
But now if we prefer NO INHERIT, I can live with that.
Regards,
Nikhils
Cumulative reaction to all the responses first:
Whoa! :)
I was under the impression that a majority of us felt that the current mechanism was inadequate. Also if you go through the nabble thread, the fact that CREATE TABLE did not support such constraints was considered to be an annoyance. And I was enquired if/when I can provide this functionality. Apologies though with the timing.
> +1 for fixing up the syntax before 9.2 goes out the door. I think theWell, it was fine in isolation, but once you consider how to make CREATE
> original syntax was misguided to begin with.
TABLE do this too, it's hard to avoid the conclusion that you need to
attach the modifier to the CHECK constraint not the ALTER TABLE command.
Yeah, exactly.
> CHECK NO INHERIT sounds fine to me; will that display ALTER TABLE ONLYs/display/displace/, I think you meant? Yeah, that's what I understand
> x as the one true way of doing this?
the proposal to be.
Displace yes. It would error out if someone says
ALTER TABLE ONLY... CHECK ();
suggesting to use the ONLY with the CHECK.
This patch does this and also makes both CREATE TABLE and ALTER TABLE use it in a uniform manner.
Regarding "NO INHERIT" versus "ONLY", we again have had discussions on the longish original thread quite a while back:
http://postgresql.1045698.n5.nabble.com/Check-constraints-on-partition-parents-only-tt4633334.html
But now if we prefer NO INHERIT, I can live with that.
Regards,
Nikhils
В списке pgsql-hackers по дате отправления: