Re: string PK vs. interger PK - Mailing list pgsql-admin

From Dan Langille
Subject Re: string PK vs. interger PK
Date
Msg-id 20020415200405.9BCD93F28@bast.unixathome.org
Whole thread Raw
In response to Re: string PK vs. interger PK  ("Nick Fankhauser" <nickf@ontko.com>)
List pgsql-admin
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


pgsql-admin by date:

Previous
From: "Marc Mitchell"
Date:
Subject: Re: string PK vs. interger PK
Next
From: "Bojan Belovic"
Date:
Subject: Killing a child process