From: Chris Browne <cbbrowne@acm.org>
To: pgsql-sql@postgresql.org
Subject: Re: unique constraint instead of primary key? what
Date: Fri, 10 Feb 2006 15:11:47 -0500
Message-ID: <60d5hvezy4.fsf@dba2.int.libertyrms.com> (raw)
References: <20060208210455.5d6f5bf9.gry@ll.mit.edu>
<1139502179.764894.35960@o13g2000cwo.googlegroups.com>
<20060209151018.58bec92d.gry@ll.mit.edu>
gry@ll.mit.edu (george young) writes:
> On 9 Feb 2006 08:22:59 -0800
> "BigSmoke" <bigsmoke@gmail.com> threw this fish to the penguins:
>
>> If my tables have one or more UNIQUE constraints/indices, I still add a
>> "id SERIAL PRIMARY KEY" field to most of my tables. This makes
>> referencing easier and faster. It also improves consistency, which is
>> never a bad thing in my opinion.
>
> In this schema overhaul I'm trying to *eliminate* arbitrary "id" columns like
> this. They may sometimes improve performance, but certainly obscure the
> meaning of the data -- naive [read-only] users accessing through excel are
> confused by this sort of thing.
Actually, that's not the only people that get confused.
I'm not usually considered overly naive, and there is a database that
I have been using for reverse-engineering purposes of late which is
filled with both "id" and "v_id" columns which *very* much obscure the
meaning of the data.
I'm not adverse to having some such thing; I *am* adverse to giving
them such generic names.
It would be nice to be certain that the "would-be primary key
characteristics" that you'd probably rather use are sufficiently
permanent to be satisfactory. Unfortunately, they often aren't, or
aren't acceptably usable.
--
output = reverse("gro.gultn" "@" "enworbbc")
http://cbbrowne.com/info/oses.html
"To conquer the enemy without resorting to war is the most desirable.
The highest form of generalship is to conquer the enemy by strategy."
-- Sun Tzu, "The Art of War"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: cbbrowne@acm.org
Subject: Re: unique constraint instead of primary key? what
In-Reply-To: <60d5hvezy4.fsf@dba2.int.libertyrms.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox