problem with foreign key - Mailing list pgsql-admin

From Ljubomir Erdeljan
Subject problem with foreign key
Date
Msg-id 4C83FAD2.6050906@chello.at
Whole thread Raw
Responses Re: problem with foreign key  (Szymon Guz <mabewlun@gmail.com>)
Re: problem with foreign key  (Bèrto ëd Sèra <berto.d.sera@gmail.com>)
List pgsql-admin
   hi group,

trying to create foreign key:

ALTER TABLE porder1 ADD CONSTRAINT order_exist
FOREIGN KEY (docuuserid) REFERENCES trade(tradeid) ON DELETE RESTRICT;

column docuuserid is integer in porder1
column tradeid    is serial  in trade and belong to primary key (single
column)

getting In EMS PostgreSQL
ERROR:  insert or update on table "porder1" violates foreign key
constraint "order_exist"
DETAIL: Key (docuuserid)=(8415) is not present in table "trade".

In PostgreSQL  Code Factory
SQL Error: ERROR:  insert or update on table "porder1" violates foreign
key constraint "order_exist"
DETAIL:    Key (docuuserid)=(8415) is not present in table "trade".

postgresql 8.4.4-1 on windows 7 ultimate 64 bit standard installation

I'm not able to figure out what should be a problem.



kindly regards

ljubomir erdeljan

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql language differences betw 7.4 and 8.0
Next
From: Szymon Guz
Date:
Subject: Re: problem with foreign key