Sven K�hler wrote : 

>> what did i do wrong?
>> what might cause this error?
>> 
>> it's a simple create table command.
>> 
>> i'm still searching for a small example to reproduce this, but it's 
>> harder than i thought.

>i couldn't find any simpler test-case.
>i cannot imagine, why this should fail, but the last create table 
>command fails (with the error in the subject):

>CREATE TABLE base_landesverb�nde (
>id_lvb INT DEFAULT SERIAL,
>PRIMARY KEY (id_lvb))
>//
>CREATE TABLE base_bundesl�nder (
>id_bundesland INT DEFAULT SERIAL,
>PRIMARY KEY (id_bundesland))
>//
>CREATE TABLE data_benutzer (
>id_benutzer INT DEFAULT SERIAL,
>id_lvb INT ,
>FOREIGN KEY id_lvb(id_lvb) REFERENCES base_landesverb�nde(id_lvb) ON 
>DELETE CASCADE,
>PRIMARY KEY (id_benutzer))
>//
>CREATE TABLE pa_data_artikel (
>id_artikel INT DEFAULT SERIAL,
>id_lvb INT ,
>id_bundesland INT ,
>FOREIGN KEY id_lvb(id_lvb) REFERENCES base_landesverb�nde(id_lvb) ON 
>DELETE CASCADE,
>FOREIGN KEY id_bundesland(id_bundesland) REFERENCES 
>base_bundesl�nder(id_bundesland) ON DELETE CASCADE,
>PRIMARY KEY (id_artikel))
>//
>CREATE TABLE pa_data_artikel_hist (
>id_hist INT DEFAULT SERIAL,
>id_artikel INT NOT NULL,
>id_benutzer INT ,
>FOREIGN KEY id_artikel(id_artikel) REFERENCES 
>pa_data_artikel(id_artikel) ON DELETE CASCADE,
>FOREIGN KEY id_benutzer(id_benutzer) REFERENCES 
>data_benutzer(id_benutzer) ON DELETE SET NULL,
>PRIMARY KEY (id_hist))

The reason why you couldn't create the foreign key can be found at

http://www.sapdb.org/htmhelp/df/e7c0ebebfe11d2a97a00a0c9449261/content.htm

This rule has been introduced to be sure that the execution of cascading delete 
statements 
do not depend on the order of execution. We know that that rule is a bit to strict in 
some
cases. This seems to be the case in your example.
We will change the behavior with one of the next releases.

Regards,
Thomas 


-- 
Thomas Anhaus
SAP DB, SAP Labs Berlin
[EMAIL PROTECTED]
http://www.sapdb.org/
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general


_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to