List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 17 1999 5:54pm
Subject:UNIQUE -vs- PRIMARY KEY
View as plain text  
>>>>> "WJ" == WJ Gilmore <gilmore@stripped> writes:

WJ> Hi there.
WJ> I would like to clear a minor bit of confusion that I have been having
WJ> regarding the creation of table columns and whether to use PRIMARY KEY
WJ> or UNIQUE to set up a column that will contain a unique value.

>> From the docs., it seems as if there is no real distinction between the
WJ> definition of PRIMARY KEY and UNIQUE. Is this true? I ask this because
WJ> it seems as if the docs go through quite a bit of trouble to denote each
WJ> when necessary.

WJ> In short, are they one in the same? If not, could somebody please list
WJ> the differences?

Hi!

The only difference is that a PRIMARY key is named 'PRIMARY' while an
UNIQUE KEY may have any name.

Regards,
Monty
Thread
UNIQUE -vs- PRIMARY KEYWJ Gilmore15 Sep
  • Re: UNIQUE -vs- PRIMARY KEYBob Kline15 Sep
  • UNIQUE -vs- PRIMARY KEYMichael Widenius17 Sep
    • Re: UNIQUE -vs- PRIMARY KEYPaul DuBois17 Sep