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 1tflto-004wyl-Qq for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2025 20:21:29 +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 1tfltl-000akz-0P for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2025 20:21:25 +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 1tfltk-000akp-Ln for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2025 20:21:24 +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 1tflth-003NNR-13 for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2025 20:21:23 +0000 Received: from smarthost-dus.org-dns.com (localhost [127.0.0.1]) by smarthost-dus.org-dns.com (Postfix) with ESMTP id A9A94A16D8 for ; Wed, 5 Feb 2025 21:15:42 +0100 (CET) Received: by smarthost-dus.org-dns.com (Postfix, from userid 1001) id 9CA0DA16DF; Wed, 5 Feb 2025 21:15:42 +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 61AA3A16D8 for ; Wed, 5 Feb 2025 21:15:42 +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 21:15:41 +0100 MIME-Version: 1.0 Subject: Re: Lookup tables To: pgsql-general@lists.postgresql.org References: <6DCD3899-51A8-4032-A189-F2B51AD7CC8F@kleczek.org> <4B983ADC-3A5C-442F-B377-D0C10FC1C100@kleczek.org> Content-Language: de-CH-frami, en-GB, it-CH, fr-CH, es-CL, es-ES From: Thiemo Kellner In-Reply-To: <4B983ADC-3A5C-442F-B377-D0C10FC1C100@kleczek.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <173878654212.3411338.11904175196985166766@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 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?