Re: 8.4.0 bug - failure to enforce a foreign key constraint

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: 8.4.0 bug - failure to enforce a foreign key constraint
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C203937EC4@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на 8.4.0 bug - failure to enforce a foreign key constraint  (Radoslaw Zielinski <radek@pld-linux.org>)
Ответы Re: 8.4.0 bug - failure to enforce a foreign key constraint
Список pgsql-general
Radoslaw Zielinski wrote:
>   radek=# \d kandydaci
>              Table "public.kandydaci"
>         Column       |       Type       | Modifiers 
>   -------------------+------------------+-----------
>    id_rekordu        | bigint           | not null
>    id_osoby          | integer          | not null
>    id_rodzaju_adresu | smallint         | 
>    score             | double precision | not null
[...]
>   Foreign-key constraints:
>       "kandydaci_fk_id_rekordu" FOREIGN KEY (id_rekordu) REFERENCES rekordy(id) ON DELETE CASCADE
> 
>   radek=# select count(*), sum((r.id is null)::int) as 
> orphans from kandydaci k left join rekordy r on r.id=k.id_rekordu;
>    count | orphans 
>   -------+---------
>     1472 |     152
>   (1 row)
> 
> The "orphans" count should be 0, obviously.

Just to make sure that there is really an inconsistency:

Could you pg_dump both tables and try to load them into
another database? If that works without errors, we must have
missed something obvious.

Yours,
Laurenz Albe

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

Предыдущее
От: Christophe Pettus
Дата:
Сообщение: Video from the August 11, 2009 SFPUG meeting available
Следующее
От: Scara Maccai
Дата:
Сообщение: Re: totally different plan when using partitions