Re: IS it a good practice to use SERIAL as Primary Key? - Mailing list pgsql-general

From Harald Armin Massa
Subject Re: IS it a good practice to use SERIAL as Primary Key?
Date
Msg-id 7be3f35d0611272158y23ae088au9170aca1cfc7316f@mail.gmail.com
Whole thread Raw
In response to Re: IS it a good practice to use SERIAL as Primary Key?  (Ron Johnson <ron.l.johnson@cox.net>)
Responses Re: IS it a good practice to use SERIAL as Primary Key?  (Ron Johnson <ron.l.johnson@cox.net>)
List pgsql-general
Ron,

> In the "real world" there is no such thing as a primary key. At least not
> over time. Not enough people understand the concept of a primary key to
> make those things existent in the real world.

There are lots of numbers.  Credit card numbers, account numbers
sales ticket numbers, etc, etc ad nauseum.  Julian day and Julian
date, even.  You can't have lived in "the west" in the past 30 years
without being surrounded by them.

Yes. There are a lot of numbers, but I the concept of a "primary key" is totally different from the concept of "number".

a "Primary Key" is supposed to identify <something< across time and space.

Some time people thought that an IP-Number will do this... soonly after there was NAT.

Again, somebody thougt, "every microsecond is unique", and then there was daylight saving.

Who gives guarantees that credit card numbers will not get reused after years of inactivity?

Yes, there are natural keys, and it's good to use them to identify things for humans. But I got bitten many times by using them as primary. Many things that "will not change, ever", just were changed on the next meeting.

Harald
--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Python: the only language with more web frameworks than keywords.

pgsql-general by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Why overlaps is not working
Next
From: Jim Nasby
Date:
Subject: Re: Solaris 10 problem