On Feb 27, 8:41 am, "AD7six" <[EMAIL PROTECTED]> wrote:
>
> Does it? I always thought not including a unique index on a table's
> data allowed duplicates.
>
> And I feel that's all the article proves. The PK is for identifying a
> row of data, a unique index is for preventing duplicates. There are
> times when the two can be one and the same, but in most cases they
> should not - if only because choosing something that seems to be
> unique which turns out not to be, or in some cases is null, is so
> difficult to rectify (quickly).
>
Primary Keys and Unique Keys are subtly different. A Unique Key will
allow nulls (and therefore duplicate records for that key) unless the
column is defined as not null whereas a primary key does not allow
nulls and the column is implicitly not nullable. Compound primary keys
will treat null columns as part of the key, so only one combination
can exist.
.
>
> All IMO of course :),
>
> AD
Ditto ~GreyCells
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---