Re: Violation of non existing reference - Mailing list pgsql-general

From Tom Lane
Subject Re: Violation of non existing reference
Date
Msg-id 18430.1204824464@sss.pgh.pa.us
Whole thread Raw
In response to Violation of non existing reference  (js@deriva.de)
List pgsql-general
js@deriva.de writes:
> 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?

What PG version is this?  Are the two columns of identical datatypes?
(I'm wondering about possible funny effects from blank-padding rules,
for example, if one is char and the other is text or varchar.)
You might also try REINDEXing both tables just in case the problem is a
corrupt index.

            regards, tom lane

pgsql-general by date:

Previous
From: js@deriva.de
Date:
Subject: Violation of non existing reference
Next
From: Ralph Smith
Date:
Subject: Re: I'm in need of something that should be there