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 1tfKLy-001RsL-3O for pgsql-general@arkaria.postgresql.org; Tue, 04 Feb 2025 14:56:42 +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 1tfKLx-0048E8-62 for pgsql-general@arkaria.postgresql.org; Tue, 04 Feb 2025 14:56:41 +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 1tfKLw-0048Ak-PF for pgsql-general@lists.postgresql.org; Tue, 04 Feb 2025 14:56:40 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tfKLu-0038ZW-2D for pgsql-general@postgresql.org; Tue, 04 Feb 2025 14:56:39 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-2a3d8857a2bso2935672fac.1 for ; Tue, 04 Feb 2025 06:56:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738680998; x=1739285798; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=N0Vp6Hf/LCgXnXMiqlNVe1ixE0MvOPkCzSZgg+SzIhY=; b=MORCMK0oJ7CCcWtz4X1brR2mKEtndo/cTdyKrddiVCykel9vo/Z4lWqxZmEhj6kfnp T7Rvs4WdkCFuReo04HfMfkl4jkkmd3cQ9QzEVPTe4afuSbi5oJjJIjvIHWqO//E/ONCp adpJUUYcp5HrpoN98qmlZ6V0t+qObt6wH+Ej8QFeSKqWk/tqv/TJd5TmIWMbsv8SZpD0 H1ErpN2csKSR8QFrHHl/Wu7z5nquKVgPmBDXp2dTS7yqSuOcWi+UwpInI262lwYfaMbA SWemMZP63OkJNg+phyELzNbNW2CJPiEZaJ91ds6qDE7nFaABUViPNLYm+aNR4rQaJ05A CJMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738680998; x=1739285798; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=N0Vp6Hf/LCgXnXMiqlNVe1ixE0MvOPkCzSZgg+SzIhY=; b=UlK4tPY+kg3QB95UA5nRNCODBAGvuVJIpmFOR2znP9eNRjTsWTgo0sX0J0i6OZpuPp pTXkoXY4hbIZ+6Z4XJW/K1jVQ5wPI3+H6zRVoJSno8I2XSLMV1wneqx0V4Ku+VD4GmR2 soVDR5zHyO295i2xj0f4hrUn5dgdDi8Gs1Y8t/4ciHQ/8qxxDbHisLWQncimL/PInfmO XgmeOO/lGQw+RlZRmGWbKrRcKw+UUalbQkHcmDvnisyuCuaBiCrwUQzWvtQQIWRibfrk 1uZ5AIAj8ECVnUKbeGHRURju+PQLrHy310Mpe/8eeSEPNVt6RN3JojWQ32qd0qneRGBg unaw== X-Gm-Message-State: AOJu0Yz5xKCuZPqQKdWZi8xerjIIL/0V3pxn8e8MQrqysVVM3jNhbJyl 5Y4yeI+60tlYjD7jXYpC/m/CokcD2oTHRwMnDHFVBBi7bcMH4HjwcudAL7s9k/lGrBkDh9nvgPH VTeSTqgWZ7Dvo7cjufwP4wQc5ySIqtyko X-Gm-Gg: ASbGnct9JGQgY2+hX72l9vgIV4zIT0+RVYMNIa+y+6+e4oqg7zqEllLPrHdm8FIKGHJ 51QQ80Z+pSab8jnWTCSImfy5Tc4AQWU9zv4agfIU26mwMGGlLFvxw0kqvLdPH43HEILr6OnM6Ff CdWod9bjLxgeCwq22C0ddpN3pBw4glcdw= X-Google-Smtp-Source: AGHT+IEL0MgU4ONz35XoeU1UEDJC4uh/d89BBWBWlquk8SijE0mFQIeMlmMXiLVnHG6aYA08FEYKyAkVY6R3MEb3p70= X-Received: by 2002:a05:6871:2009:b0:2a3:d9b3:3d01 with SMTP id 586e51a60fabf-2b32f2d8137mr17274464fac.29.1738680997907; Tue, 04 Feb 2025 06:56:37 -0800 (PST) MIME-Version: 1.0 References: <4e7a338-c7d3-e944-20bd-a6e346e175c7@appl-ecosys.com> In-Reply-To: From: Ron Johnson Date: Tue, 4 Feb 2025 09:56:26 -0500 X-Gm-Features: AWEUYZktveELzR0ghNT5Obdm2g7dCygB02e52P28oJDrw9jeIhYtorx3BN3A6so Message-ID: Subject: Re: Lookup tables To: pgsql-general Content-Type: multipart/alternative; boundary="00000000000042180c062d5237e1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000042180c062d5237e1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Feb 4, 2025 at 9:41=E2=80=AFAM David G. Johnston wrote: > On Tuesday, February 4, 2025, Rich Shepard > wrote: > >> Should lookup tables have a numeric FK column as well as the description >> column? >> >> If so, how should I add an FK to the two lookup tables in my database? >> > > Most do (have a surrogate PK) since it removes cascading updates > How does a synthetic PK "remove cascading updates"? Doesn't the decision on whether or not to cascade update depend on the ON UPDATE CASCADE clause of the FK definition? --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --00000000000042180c062d5237e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Feb 4, 2025 at 9:41=E2=80=AFAM Da= vid G. Johnston <david.g.j= ohnston@gmail.com> wrote:
On Tuesday, F= ebruary 4, 2025, Rich Shepard <rshepard@appl-ecosys.com> wrote:
Should lookup tables have a numeric = FK column as well as the description column?

If so, how should I add an FK to the two lookup tables in my database?

Most do (have a surrogate PK) since it rem= oves cascading updates
=C2=A0
How do= es a synthetic PK "remove cascading updates"?=C2=A0 Doesn't t= he decision on whether or not to cascade update depend on the ON UPDATE CAS= CADE clause of the FK definition?

--
=
Death to <Redacted>, and butter sauce.
Don't= boil me, I'm still alive.
<Redacted> lobster!
=
--00000000000042180c062d5237e1--