Skip navigation links

MySQL Forums :: Constraints :: Dual-row primary key and unique constraint


Advanced Search

Dual-row primary key and unique constraint
Posted by: Ole Nielsby ()
Date: March 19, 2010 01:19PM

I'm creating a table for language preference. The user settings will include an ordered list of languages.

For this I create a table with 3 INT columns:
user_id
language_id
rank

and define (user_id, language_id) as primary key (a user can't prefer the same language twice), and (user_id, rank) as a unique constraint.

phpAdmin gives me a warning that reads

"PRIMARY and INDEX keys should not both be set for column user_ID"
(I translated the warning from Danish, the wording could be different)

Why is that? Can I ignore this warning?

I'm using phpMyAdmin 2.8.2.4/MySQL clientversion: 5.0.51a

Options: ReplyQuote


Subject Views Written By Posted
Dual-row primary key and unique constraint 5284 Ole Nielsby 03/19/2010 01:19PM
Re: Dual-row primary key and unique constraint 1982 Peter Brawley 03/19/2010 03:58PM
Re: Dual-row primary key and unique constraint 2186 Ole Nielsby 03/19/2010 07:36PM
Re: Dual-row primary key and unique constraint 1776 Peter Brawley 04/10/2010 08:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.