Skip site navigation (1) Skip section navigation (2)

foreign key problem

From: Ljubomir Erdeljan <ljubomir(dot)erdeljan(at)chello(dot)at>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: foreign key problem
Date: 2010-09-05 20:18:31
Message-ID: 4C83FB17.2030105@chello.at (view raw or flat)
Thread:
Lists: pgadmin-hackers
  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


pgadmin-hackers by date

Next:From: Ljubomir ErdeljanDate: 2010-09-05 22:17:24
Subject: foreign key problem resolved
Previous:From: Guillaume LelargeDate: 2010-09-03 22:39:42
Subject: Re: Fwd: Pgadmin 1.12 rc1 editing bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group