Re: Violation of non existing reference

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: js(at)deriva(dot)de
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Violation of non existing reference
Date: 2008-03-06 17:27:44
Message-ID: 18430.1204824464@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

js(at)deriva(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ralph Smith 2008-03-06 17:52:28 Re: I'm in need of something that should be there
Previous Message Thomas Kellerer 2008-03-06 15:23:54 Re: mssql to postgres problems with bytea help needed