From: Dan Langille <dan@langille.org>
To: Postgres Admin List <pgsql-admin@postgresql.org>
Subject: Re: string PK vs. interger PK
Date: Mon, 15 Apr 2002 16:02:44 -0400
Message-ID: <20020415200405.9BCD93F28@bast.unixathome.org> (raw)
In-Reply-To: <NEBBLAAHGLEEPCGOBHDGKEHNEMAA.nickf@ontko.com>
References: <019201c1e4af$3b855c90$de138f80@virginia.edu>
On 15 Apr 2002 at 14:20, Nick Fankhauser wrote:
> As a general rule, a primary key (or any relationship key) should not
> contain a value that means something beyond its use in relating entities.
> The problem is that if a field describes an object, the day may come when
> you want to change the description, but you *never* want to change the
> field that identifies the record and relates it to other records.
FWIW, I would recommend not using business values as a primary key (and by
extension, as a foreign key). Business values are just that: business
values. Sure, put unique constraints on business values if you want.
Just don't make them a primary key or a foreign key.
--
Dan Langille
The FreeBSD Diary - http://freebsddiary.org/ - practical examples
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: dan@langille.org
Subject: Re: string PK vs. interger PK
In-Reply-To: <20020415200405.9BCD93F28@bast.unixathome.org>
References: <019201c1e4af$3b855c90$de138f80@virginia.edu> <20020415200405.9BCD93F28@bast.unixathome.org>
* 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