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

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: how to create a non-inherited CHECK constraint in CREATE TABLE
Дата
Msg-id CA+TgmoYRPUEbDoGi4dk94uT5K-yVLHFKBVw=YuSx5ojORnxH+A@mail.gmail.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  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On Wed, Jan 18, 2012 at 12:10 AM, Nikhil Sontakke <nikkhils@gmail.com> wrote:
>> >> It appears that the only way to create a non-inherited CHECK constraint
>> >> is using ALTER TABLE.  Is there no support in CREATE TABLE planned?
>> >> That looks a bit odd.
>> >
>> > There are no plans to do that AFAIR, though maybe you could convince
>> > Nikhil to write the patch to do so.
>>
>> That certainly doesn't meet the principle of least surprise... CREATE
>> TABLE should support this.
>
> Well, the above was thought about during the original discussion and
> eventually we felt that CREATE TABLE already has other issues as well, so
> not having this done as part of creating a table was considered acceptable
> then:
>
> http://postgresql.1045698.n5.nabble.com/Check-constraints-on-partition-parents-only-tt4633334.html#a4647144
>
> But, let me have a stab at it when I get some free cycles.

I agree with Peter that we should have we should have CHECK ONLY.
ONLY is really a property of the constraint, not the ALTER TABLE
command -- if it were otherwise, we wouldn't need to store it the
system catalogs, but of course we do.  The fact that it's not a
standard property isn't a reason not to have proper syntax for it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi)
Дата:
Сообщение: Re: gistVacuumUpdate
Следующее
От: Gražvydas Valeika
Дата:
Сообщение: Strange primary key constraint influence to grouping