Re: BUG #4709: dump/restore introduces wrong CHECK constraint for inherited table
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #4709: dump/restore introduces wrong CHECK constraint for inherited table |
| Дата | |
| Msg-id | 6887.1237293401@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | BUG #4709: dump/restore introduces wrong CHECK constraint for inherited table ("Andrey" <andrey@ulab.ru>) |
| Список | pgsql-bugs |
"Andrey" <andrey@ulab.ru> writes:
> Assume we have 2 tables with additionally added CHECK constraints:
> ...
> ALTER TABLE ONLY t ADD CONSTRAINT type_eq_zero CHECK (type = 0);
The way this is addressed in CVS HEAD is that such commands are
forbidden:
regression=# ALTER TABLE ONLY t ADD CONSTRAINT type_eq_zero CHECK (type = 0);
ERROR: constraint must be added to child tables too
An "ONLY" check constraint isn't very reasonable because then the table
would appear to contain rows that violate the constraint. What I'd
suggest for what you seem to be trying to accomplish is to have an
empty parent table and two child tables, each with a constraint
restricting the "type" column. The information on partitioning in the
manual might help you, since this is fundamentally a partitioning setup.
The behavior of 8.3 and before in this regard won't be changed.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера