Re: PRIMARY KEYS

From: elein <elein(at)varlena(dot)com>
To: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org
Cc: elein(at)varlena(dot)com
Subject: Re: PRIMARY KEYS
Date: 2003-05-22 01:03:09
Message-ID: 200305211803.09197.elein@varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


This is unlike any database theory I've heard of.
Choosing a natural key over an artificial key is
the ideal. I've heard that a lot.

Sometimes there are several candidate keys to
choose from. And sometimes the primary keys
are more than one column.

Sometimes I bail out to an artificial key when the
primary key is too long, but it depends very much on how
the table will be accessed and who knows what and
when.

--elein

On Tuesday 20 May 2003 05:41, Karsten Hilbert wrote:
> And - if you agree with database theory - a bad one at that.
> Supposedly primary keys should be void of any meaning bar
> their primary key-ness. I got into the habit of starting
> any but the most simple table like this:
>
> create table (
> id serial primary key,
> ...
>
> Never had any trouble with that. Good or bad practice ? Gotta
> decide for yourself.
>
> Karsten
> --
> GPG key ID E4071346 @ wwwkeys.pgp.net
> E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>

--
=============================================================
elein(at)varlena(dot)com Database Consulting www.varlena.com
PostgreSQL General Bits http:/www.varlena.com/GeneralBits/
"Free your mind the rest will follow" -- en vogue

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Justin Clift 2003-05-22 01:18:10 Re: [GENERAL] pam-linux, /etc/shadow : HOW-TO
Previous Message Martijn van Oosterhout 2003-05-22 00:44:20 Re: PRIMARY KEYS