pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ljubomir Erdeljan <ljubomir.erdeljan@chello.at>
To: pgsql-admin@postgresql.org
Subject: problem with foreign key
Date: Sun, 05 Sep 2010 22:17:22 +0200
Message-ID: <4C83FAD2.6050906@chello.at> (raw)

   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



view thread (7+ messages)  latest in thread

Message-ID: <4C83FAD2.6050906@chello.at>
Permalink:  ../4C83FAD2.6050906@chello.at/
Also on:    postgresql.org/message-id/4C83FAD2.6050906@chello.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ljubomir.erdeljan@chello.at
  Subject: Re: problem with foreign key
  In-Reply-To: <4C83FAD2.6050906@chello.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox