Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tfjoI-004ivd-JM for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2025 18:07:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tfjoH-00Gmkd-MH for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2025 18:07:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tfjoH-00Gmig-BH for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2025 18:07:37 +0000 Received: from sm-r-008-dus.org-dns.com ([84.19.1.236]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tfjoE-003MAi-1a for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2025 18:07:36 +0000 Received: from smarthost-dus.org-dns.com (localhost [127.0.0.1]) by smarthost-dus.org-dns.com (Postfix) with ESMTP id 6D2B8A179B for ; Wed, 5 Feb 2025 19:07:30 +0100 (CET) Received: by smarthost-dus.org-dns.com (Postfix, from userid 1001) id 60621A178E; Wed, 5 Feb 2025 19:07:30 +0100 (CET) X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_INFOUSMEBIZ, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 Received: from ha01s018.org-dns.com (ha01s018.org-dns.com [62.108.32.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smarthost-dus.org-dns.com (Postfix) with ESMTPS id 1A64AA179F for ; Wed, 5 Feb 2025 19:07:30 +0100 (CET) Authentication-Results: ha01s018.org-dns.com; spf=pass (sender IP is 146.185.68.202) smtp.mailfrom=thiemo@gelassene-pferde.biz smtp.helo=[192.168.178.23] Received-SPF: pass (ha01s018.org-dns.com: connection is authenticated) Message-ID: Date: Wed, 5 Feb 2025 19:07:30 +0100 MIME-Version: 1.0 Subject: Re: Lookup tables To: pgsql-general@lists.postgresql.org References: <6DCD3899-51A8-4032-A189-F2B51AD7CC8F@kleczek.org> Content-Language: de-CH-frami, en-GB, it-CH, fr-CH, es-CL, es-ES From: Thiemo Kellner In-Reply-To: <6DCD3899-51A8-4032-A189-F2B51AD7CC8F@kleczek.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <173877884974.3311453.8747208335992701200@ha01s018.org-dns.com> X-PPP-Vhost: gelassene-pferde.biz X-POWERED-BY: wint.global - AV:CLEAN SPAM:OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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).