Re: Avoiding surrogate keys - Mailing list pgsql-general

From Richard Broersma
Subject Re: Avoiding surrogate keys
Date
Msg-id AANLkTimDSvExnsKZ_yD2H_kYPdHWaKPMF9tdtkjE0ekH@mail.gmail.com
Whole thread Raw
In response to Re: Avoiding surrogate keys  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Responses Re: Avoiding surrogate keys  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
List pgsql-general
2010/5/4 Grzegorz Jaśkiewicz <gryzman@gmail.com>:
>
> Another thing, If your PK changes, it is no longer a PK, you can't rely on it.

Depending upon what you mean by changes this could be true or it could
be a matter of opinion.  If your referring to a candidate key's value
changes, this key still provides a useful way to identify a tuple.

Also, just because a surrogate key is a useful way to identify a row,
by itself it does nothing to uniquely identify an entity that a row
represents.  On some DBMS forums that I frequent, it is a daily
occurrence to see questions on how to eliminate duplicate rows.  So,
for some people, there are times when even surrogate keys cannot be
relied upon as a PK.
--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: GeSHi module for Postgresql?
Next
From: Tom Lane
Date:
Subject: Re: pg9 beta1, make check fails