Re: Self referential foreign keys in partitioned table not working as expected

Поиск
Список
Период
Сортировка
От Christoph Berg
Тема Re: Self referential foreign keys in partitioned table not working as expected
Дата
Msg-id Z-u9dhA5ikSgOul9@msg.df7cb.de
обсуждение исходный текст
Ответ на Self referential foreign keys in partitioned table not working as expected  (Luca Vallisa <luca.vallisa@gmail.com>)
Ответы Re: Self referential foreign keys in partitioned table not working as expected
Список pgsql-bugs
Re: Luca Vallisa
> create table test (
>     id_1 int4 not null,
>     id_2 int4 not null,
>     parent_id_1 int4 null,
>     primary key (id_1, id_2),
>     foreign key (parent_id_1, id_2) references test(id_1, id_2)
> ) partition by list(id_1);
> 
> insert into test values (1, 1, null), (1, 2, 1);

Multi-column foreign keys where one column is NULL effectively disable
the FK, this is not specific to partitioned tables. They works as
designed, but best avoid them.

Christoph



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