Re: surrogate key or not?

Поиск
Список
Период
Сортировка
От Kenneth Gonsalves
Тема Re: surrogate key or not?
Дата
Msg-id 0408070930300J.01190@thenilgiris.com
обсуждение исходный текст
Ответ на Re: surrogate key or not?  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: surrogate key or not?  (Oliver Elphick <olly@lfix.co.uk>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Grouping by week
Следующее
От: Kenneth Gonsalves
Дата:
Сообщение: reply to setting