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 18:07:30
Message-ID: c77aae45-5914-4973-8d32-9b6efa6545d9@gelassene-pferde.biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-general

El 04-02-25 a las 18:08, Michał Kłeczek escribió:
>> Reality tends to become so ambiguous as to not be
>> reflectable (two entirely different restaurants eventually,
>> within the flow of time, carry the very same name).
>>
>> A primary key is very likely not the proper place to reflect
>> arbitrary business logic (is it the same restaurant or not ?
>> what if two restaurants have the same name at the same time
> These are of course problems ( and beyond the scope of my contrived example ).
>
> The point is though, that having surrogate PK not only does not solve these issues but makes them worse by kicking the can down the road and allowing for inconsistencies.
Only if you do not see the primary key as the main immutable value
identifying an object, entity, you name it. Having said that, it is very
questionable that a natural key (names to name one) can be a suitable
primary key (think of typo).

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Michał Kłeczek 2025-02-05 18:13:49 Re: Lookup tables
Previous Message Thiemo Kellner 2025-02-05 17:27:34 Re: Lookup tables

Browse pgsql-general by date

  From Date Subject
Next Message Michał Kłeczek 2025-02-05 18:13:49 Re: Lookup tables
Previous Message Csányi Pál 2025-02-05 18:05:49 Using PgAgent with SQL commands only?