Re: [GENERAL] Violation of non existing reference

2008-03-07 Thread Tom Lane
[EMAIL PROTECTED] writes: > Sorry, I was wrong. It's a charachter(12) not a varchar and it's a > domain. > The isins in z_ul either start with 'DE000' or with 'CH003'. PG seems > to compare only the first few charachters because when I set the > reference to CASCADE all z_ul entries that start with

Re: [GENERAL] Violation of non existing reference

2008-03-06 Thread js
Sorry, I was wrong. It's a charachter(12) not a varchar and it's a domain. The isins in z_ul either start with 'DE000' or with 'CH003'. PG seems to compare only the first few charachters because when I set the reference to CASCADE all z_ul entries that start with 'DE000' are deleted. I tested it in

Re: [GENERAL] Violation of non existing reference

2008-03-06 Thread Tom Lane
[EMAIL PROTECTED] writes: > It's Version 8.3. > Both columns are of a user defined datatype which is a varchar(12) > with a special check. You mean a DOMAIN, or you mean a special datatype with custom C code? If the latter, I'd suspect the C code. 8.3 has more stringent coding rules for variable-

Re: [GENERAL] Violation of non existing reference

2008-03-06 Thread js
It's Version 8.3. Both columns are of a user defined datatype which is a varchar(12) with a special check. I already did a REINDEX but it didn't help. On 6 Mrz., 18:27, [EMAIL PROTECTED] (Tom Lane) wrote: > What PG version is this? Are the two columns of identical datatypes? > (I'm wondering abo

Re: [GENERAL] Violation of non existing reference

2008-03-06 Thread Tom Lane
[EMAIL PROTECTED] 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: K

[GENERAL] Violation of non existing reference

2008-03-06 Thread js
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 = 'DE000DB3BT