Re: Primary Keys optional?

  • From: "Dennis Williams" <oracledba.williams@xxxxxxxxx>
  • To: andert@xxxxxxxxx
  • Date: Thu, 17 Aug 2006 12:33:32 -0500

Stephen,

I come down on the side of "every table will have a primary key unless you
can provide a good reason not to". That is what I try to enforce for new
tables. Sometimes the PK is enforced with another unique index. I have
worked with applications that used unique keys instead of PK.

Dennis Williams


On 8/17/06, Stephen Andert <andert@xxxxxxxxx> wrote:

OK, just starting a new job with more design than I have done in a while. Looking into things, I have been noticing that many tables have no PK. Some have a unique index, but not all.

When I pointed this out to folks (developers) they shrugged and said
"if you need a PK, then create one".

So my questions are:

1. Is it considered acceptable to have a unique index instead of a pk?

2. What are the circumstances when a table might be allowed to exist
without any sort of primary key or unique index?  (i.e. temp table,
static small table, etc)

Thanks In Advance

--
Stephen Andert
http://spaces.msn.com/andert-news/
--
//www.freelists.org/webpage/oracle-l



Other related posts: