Re: Lookup tables - Mailing list pgsql-general

From Thiemo Kellner
Subject Re: Lookup tables
Date
Msg-id f2e0f8dd-172a-4522-95c7-e107e05593e5@gelassene-pferde.biz
Whole thread Raw
In response to Re: Lookup tables  (Michał Kłeczek <michal@kleczek.org>)
List pgsql-general
El 05-02-25 a las 19:13, Michał Kłeczek escribió:
>> Only if you do not see the primary key as the main immutable value identifying an object, entity, you name it.
> Surrogate key cannot identify any (real) object by definition :)
> What object is identified by PK value 42 in “restaurants” table?
What object is identified by a PK value "löasidfhaösliw" in a restaurant 
table? It is the context only giving it sense and not less sense then 42 
or "Pizza Hut". In fact on disk, you won't even find 42 or "Pizza Hut". 
On hard disks, e.g., it is the direction of a magnetic field of several 
locations on the disk. Btw, 42 seems to me a quite geeky name for a nerd 
restaurant.
>> Having said that, it is very questionable that a natural key (names to name one) can be a suitable primary key
(thinkof typo).
 
> Typos are indeed a problem but adding surrogate key does not solve it, I’m afraid.
In how far does it not solve it? Or maybe better asked. Is your problem 
that typos occur or is the problem the amount of hassle to fix it?




pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Table copy
Next
From: Thiemo Kellner
Date:
Subject: Re: Lookup tables