Search Postgresql Archives

Violation of non existing reference

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

 



Hi,

I encountered an odd behaviour when I tried to delete a record.
I have two tables "z_base" and "z_ul". z_base's primary key is "isin"
which is referenced by z_ul.

select count(*) from z_base where isin = 'DE000DB3BTR9';
 count
-------
     1

select count(*) from z_ul where isin = 'DE000DB3BTR9';
 count
-------
     0

So there is no record in z_ul that references z_base with isin
'DE000DB3BTR9', but when I do:

delete from z_base where isin = 'DE000DB3BTR9';
ERROR:  update or delete on table "z_base" violates foreign key
constraint "z_ul_isin_fkey" on table "z_ul"
DETAIL:  Key (isin)=(DE000DB3BTR9) is still referenced from table
"z_ul".

Has anyone an idea how this could happen?

Jan

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/

[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