On Tue, 2006-09-19 at 19:45 -0700, Bayle wrote:
> I'm not advocating that a detailed introduction to databases be added
> to the tutorial. But it might be nice to mention very briefly that if
> you don't know what a primary key is, it's a unique ID for each row in
> a database table, and furthermore the easiest way to deal with them is
> to add an extra column to each table of type Integer, and make that the
> primary key (unless this advice is in error; as I noted, I don't know
> anything about databases).

Many database professionals would argue against such advice.  Although a
primary key is supposed to be a unique ID for a given database "entity",
it is generally preferable to use "natural" or "standard" IDs as primary
keys.  Since the page title in the wiki is unique it's a "natural"
choice.  "Standard" IDs include things like country, currency and
language codes, SSN or other government-dictated IDs, ISBNs, UPCs, etc.
The fact that MySQL can't handle Unicode strings as primary keys is more
a reflection on the implementation.  Nevertheless, because natural
identifiers are not sufficiently unique (personal names), too lengthy (a
complete street address) or otherwise cumbersome, the practice of using
sequentially-assigned integers is quite common, although technically
they are surrogate primary keys (see
http://en.wikipedia.org/wiki/Surrogate_key).

Joe


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to