Re: Lookup tables

From: Thiemo Kellner <thiemo(at)gelassene-pferde(dot)biz>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Lookup tables
Date: 2025-02-05 20:15:41
Message-ID: f2e0f8dd-172a-4522-95c7-e107e05593e5@gelassene-pferde.biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support 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 (think of 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?

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Thiemo Kellner 2025-02-05 20:33:38 Re: Lookup tables
Previous Message Michał Kłeczek 2025-02-05 18:13:49 Re: Lookup tables

Browse pgsql-general by date

  From Date Subject
Next Message Thiemo Kellner 2025-02-05 20:33:38 Re: Lookup tables
Previous Message Adrian Klaver 2025-02-05 19:06:16 Re: Table copy