Re: surrogate key or not? - Mailing list pgsql-sql

From Kenneth Gonsalves
Subject Re: surrogate key or not?
Date
Msg-id 0408070930300J.01190@thenilgiris.com
Whole thread Raw
In response to Re: surrogate key or not?  (Josh Berkus <josh@agliodbs.com>)
Responses Re: surrogate key or not?  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-sql
On Saturday 07 August 2004 04:12 am, Josh Berkus wrote:

>
> > Meanwhile, every other aspect of the data can change (e.g. a person can
> > change his name, sex, age, email, address, even date & place of birth).
> > Not to mention data entry mistakes. So it's impossible to use any
> > "real"/natural key in this case.
>
> Absolutely false.   It's quite possible, it's just a
> performance/schema/data management issue.  This also applies to my comment
> above.

why shouldnt the primary key change? the only key that should never change is 
a key that is used as a foreign key in another table. In a table like this:

id serial unique
name varchar primary key

name may change - id will never change. id is used as the foreign key

-- 
regards
kg

http://www.onlineindianhotels.net - fastest hotel search website in the world
http://www.ootygolfclub.org


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Grouping by week
Next
From: Kenneth Gonsalves
Date:
Subject: reply to setting