Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Bugs > BUG #4119: Add ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 3718 of 3939
Post > Topic >>

BUG #4119: Add foreign key fails for non-presence of a record that does exist.

by p9e883002@[EMAIL PROTECTED] ("Buk") Apr 21, 2008 at 01:58 AM

The following bug has been logged online:

Bug reference:      4119
Logged by:          Buk
Email address:      p9e883002@[EMAIL PROTECTED]
 version: 8.2.4,
Operating system:   XP SP1
Description:        Add foreign key fails for non-presence of a record
that
does exist.
Details: 

I'm trying to run this:

big_db=# ALTER TABLE word_doc ADD FOREIGN KEY (word_id) REFERENCES words
(word_id) ON UPDATE RESTRICT ON DELETE RESTRICT;

I'm getting this error:

ERROR:  insert or update on table "word_doc" violates foreign key
constraint
"word_doc_word_id_fkey"
DETAIL:  Key (word_id)=(65935) is not present in table "words".

And yet, there is the "missing" key:

big_db=# select * from words where word_id = 65935;
 word_id |      word
---------+----------------
   65935 | bioremediation
(1 row)


What am I doing wrong??

Cheers, Buk.

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
 




 1 Posts in Topic:
BUG #4119: Add foreign key fails for non-presence of a record th
p9e883002@[EMAIL PROTECTE  2008-04-21 01:58:45 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 2:01:01 CDT 2008.