Re: 8.4.0 bug - failure to enforce a foreign key constraint - Mailing list pgsql-general

From Albe Laurenz
Subject Re: 8.4.0 bug - failure to enforce a foreign key constraint
Date
Msg-id D960CB61B694CF459DCFB4B0128514C203937EC4@exadv11.host.magwien.gv.at
Whole thread Raw
In response to 8.4.0 bug - failure to enforce a foreign key constraint  (Radoslaw Zielinski <radek@pld-linux.org>)
Responses Re: 8.4.0 bug - failure to enforce a foreign key constraint
List 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 by date:

Previous
From: Christophe Pettus
Date:
Subject: Video from the August 11, 2009 SFPUG meeting available
Next
From: Scara Maccai
Date:
Subject: Re: totally different plan when using partitions