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 1tfKU1-001Stn-L4 for pgsql-general@arkaria.postgresql.org; Tue, 04 Feb 2025 15:05:02 +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 1tfKU0-004JRy-Ca for pgsql-general@arkaria.postgresql.org; Tue, 04 Feb 2025 15:05:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tfKU0-004JRq-1s for pgsql-general@lists.postgresql.org; Tue, 04 Feb 2025 15:05:00 +0000 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tfKTx-003Fao-0w for pgsql-general@postgresql.org; Tue, 04 Feb 2025 15:04:59 +0000 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-5f2e31139d9so2646520eaf.0 for ; Tue, 04 Feb 2025 07:04:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738681496; x=1739286296; darn=postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DE/0kbea6cjHMuHkzTnp7+7PT+vGLFPVles1HyW/XvE=; b=LiBlFAldCmXFNyPYRVT4YOpbxzfnHF6xzB14xwaiHZXSfkbKfnD7s4N5Iz1lEYO15k GXM5IosSKd7P8n+hPWdZfhrJnBe6llbMlAS8A7qNubp1deG0x6dqrLRaI9DfPnjX9H3c pcFsiscjutUKkyFI6Fn3hUxXG26P1UdYdGg6uhgQ8VBPpb72V1X9QbNv3LI1swh4A+jv b+dZooLx1OijbVg6Xo0EhTyrE2lg8V/kooBLXS0hcQ/sfLlHosFaHHd6uIldIeQMDSJP 4jhLoqw7lJoJNxTLF2j/Fe/LJQQkQ6VlH8dFhg/JxMC8WzTmRvCHwbM2vLfBXuXXpoB0 Z3Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738681496; x=1739286296; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DE/0kbea6cjHMuHkzTnp7+7PT+vGLFPVles1HyW/XvE=; b=eVg93dTgfg1T9cwasKRoOfepGNf7z6+2y4LLwOxkunNCyJ2swZT8ZFdvTolegKl26P QqvUUKaE5J4mWUp5qCMv4k0J24nn39RaiwwTxnhWMiLlwpBfsXMNQGtniFJbFgOVAnQV Ej8c/ovHMA3HmFOcgZnCPW5VvK2P/Mp8oW5O8N8vo9M/WXIkC4uQ5agh8/gpdFxtNF+z RE2OzdDSDDVDWv24XSO651LOIqrWkmKOUcAF+8UTOCNhzn8j5qKPHwUZWEiLokrd81M/ OfGrwByH8ZyhgAQ2MQmGnl867neM/MFtRzoAWIeN+8TGIi03+vcyJFnbMaIw8LaEnxMH hPMw== X-Gm-Message-State: AOJu0YztbED+/p9trG46gSoNIBTpClVV5heuWrOzjTT6fuSh2t0gTNk3 dXRHI+dCQmdAWxwCaliUQqGjZd07R+Mx04irL9MgX+z+yIgyh8DjDMYmKql/i/e09gvqr80768a 09g+BZsotNRe65mwhWTnoPvtiU5g= X-Gm-Gg: ASbGncslg+cP69ubEiSzmKUsSZ05gKPBbrtvN1Kf/gYwvtr3EZcOYaSBQ2RoR+CcpbG EnlGZZngru1ZWs2l5QZ/lXO+cJtst/n9WLlQLovGP8cuWtMa6aTbrLoi2+WMu27Vvd1eWN+s= X-Google-Smtp-Source: AGHT+IEKay82JRQWhquFhcW2F8S6T2AkAiPY8hN3TkeuYWwb51dwvoebRRHVDqSJY3q05OgalM7Eh8tfQsxUKKCe+TE= X-Received: by 2002:a05:6820:2d43:b0:5f8:89bd:b99b with SMTP id 006d021491bc7-5fc0045ccccmr14870160eaf.8.1738681495846; Tue, 04 Feb 2025 07:04:55 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:6802:a0c:b0:577:9519:f64a with HTTP; Tue, 4 Feb 2025 07:04:54 -0800 (PST) In-Reply-To: References: <4e7a338-c7d3-e944-20bd-a6e346e175c7@appl-ecosys.com> From: "David G. Johnston" Date: Tue, 4 Feb 2025 08:04:54 -0700 X-Gm-Features: AWEUYZnWYikioyoG3gUdRQL_Y1t4pXemtpcQ5rRulQzyoP3RtCBW2LbL_bG6AmQ Message-ID: Subject: Re: Lookup tables To: Ron Johnson Cc: pgsql-general Content-Type: multipart/alternative; boundary="000000000000f00613062d5254f7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f00613062d5254f7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, February 4, 2025, Ron Johnson wrote: > On Tue, Feb 4, 2025 at 9:28=E2=80=AFAM Rich Shepard > wrote: > >> Should lookup tables have a numeric FK column as well as the description >> column? >> > > Does your lookup table just have one column? (That's what your question > seems to imply, but that makes no sense, since the whole point of a looku= p > table is to store some sort of a code in the "child" table instead of the > whole text of the description.) > The point of a lookup table is to provide a unique list of authoritative values for some purpose. Kinda like an enum. But having the label serve as the unique value is reasonable - we only add surrogates for optimization= . David J. --000000000000f00613062d5254f7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, February 4, 2025, Ron Johnson <ronljohnsonjr@gmail.com> wrote:
On Tue, Feb 4, 2025 at 9:28= =E2=80=AFAM Rich Shepard <rshepard@appl-ecosys.com> wrote:
Should looku= p tables have a numeric FK column as well as the description column?

Does your lookup table just have one column?= =C2=A0 (That's what your question seems to imply, but that makes no sen= se, since the whole point of a lookup table is to store some sort of a code= in the "child" table instead of the whole text of the descriptio= n.)

The point of a lookup= table is to provide a unique list of authoritative values for some purpose= .=C2=A0 Kinda like an enum.=C2=A0 But having the label serve as the unique = value is reasonable - we only add surrogates for optimization.
David J.

--000000000000f00613062d5254f7--