Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux