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 1tfM8u-001kiB-Oc for pgsql-general@arkaria.postgresql.org; Tue, 04 Feb 2025 16:51:21 +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 1tfM8t-005ZkE-Nn for pgsql-general@arkaria.postgresql.org; Tue, 04 Feb 2025 16:51:19 +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 1tfM8t-005Zk6-AN for pgsql-general@lists.postgresql.org; Tue, 04 Feb 2025 16:51:19 +0000 Received: from mout.gmx.net ([212.227.15.15]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tfM8q-0039jU-2h for pgsql-general@postgresql.org; Tue, 04 Feb 2025 16:51:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1738687875; x=1739292675; i=karsten.hilbert@gmx.net; bh=XDXNWvsAj+2LtX5cjx3uNdlKhA4e34SE+vFQfXF3SDc=; h=X-UI-Sender-Class:Date:From:To:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=TfDjMmP94R7+WQ628paZxxAsI2M2spDOc5cGkWGFoOEbSy6ak46tg9U0oR8n7ruE +7Cqk0Kk/fngn5dKaTlIWjHjxIl0rOdfTDk9OZTbjb+MbS7s3g9TrWpmJSV3H7KiN JISUps7JfrocAwdh7TtXcvIdQ3M2cJDZFiox2qgaHuwl5wzSJizNgbLvFDQ52pje5 ZOJHTmRmFaB7lSJGiapAssCaHwFoFYiOuXM0Psc4A8aT/n/UvnXzWVQv5Y9jCHS4E ZwCNUXgyf/xi6XuDH1Rt8WkY8rqWB394doXA+Ntxqw16H/yn4UJbfHA/SEKQ6xttK HhaLHlzJaYQs/dpLVQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from hermes ([84.144.215.252]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MpDJd-1t4yfl3z3f-00cq3v; Tue, 04 Feb 2025 17:51:15 +0100 Received: from ncq by hermes with local (Exim 4.96) (envelope-from ) id 1tfM8o-0001FW-12; Tue, 04 Feb 2025 17:51:14 +0100 Date: Tue, 4 Feb 2025 17:51:14 +0100 From: Karsten Hilbert To: pgsql-general@lists.postgresql.org, PG-General Mailing List Subject: Re: Lookup tables Message-ID: Mail-Followup-To: pgsql-general@lists.postgresql.org, PG-General Mailing List References: <4e7a338-c7d3-e944-20bd-a6e346e175c7@appl-ecosys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) Sender: X-Provags-ID: V03:K1:CQ04BMPXevtuZ59XUuPmaDht34Qhk+n3Q3wrgwml8sivOdqkNdk JLbhSlJIRj4YRBbQEfKvcyrbwg1wLBrDrYCxyXeNNMKFiiBWbYyc+jj25RCdkqDW2N3zvAX 9xGqtrCq3ugtqSvkxYGTBEUXQBVAnZ32RAUgD9JKQn1fa8UsG5AjRL/lKy0scIpp3Z9cBWR q5DITmEL1pfxoZPdmwwLA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:dYZNayowfdo=;3ek9I0kI6QB6c5p4AZs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Clg49V6A4p13F0oY5UHmW7OXLMKrrgt T0sNo9nz5mjd1JjdwM9okEkSEOG7JN+gYStXpyRBt7cqG6vjCXYx+z21i91Y//QQC0RCJcFzu GbtgirSrz96qFijnzmkXWLV/zTrc04WI2oL3j4buIg8+mmk/UcLP//RTcY8mOGfZRTVKGlPVz ZyWFN8wif+JpY7hOI3t7secW+Yg0D3CrGhP3X5QpWjg0YNXhAAR8EVdgfZlOJtP5A3FAz8eI3 BPrbIrrnvTwh4iVbCxW/dtaZg== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Am Tue, Feb 04, 2025 at 05:31:13PM +0100 schrieb Micha=C5=82 K=C5=82eczek: > It is now completely unclear what it means to change the name of the res= taurant for already registered visits. > Is it still the same restaurant with a different name or a different res= taurant? > > Or let say someone swaps names of two restaurants. > That means a user that goes to the same restaurant every day would regis= ter visits to two different restaurants! > > Using the name of a restaurant as primary key gets rid of these logical = anomalies because > the database model now reflects facts from reality. 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 ?). Primary keys are tools at the technical level. Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B