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 1tfKa5-001TkR-RZ for pgadmin-support@arkaria.postgresql.org; Tue, 04 Feb 2025 15:11:18 +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 1tfKa4-004VvF-Rk for pgadmin-support@arkaria.postgresql.org; Tue, 04 Feb 2025 15:11:16 +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 1tfKa4-004Vv6-Kg for pgadmin-support@lists.postgresql.org; Tue, 04 Feb 2025 15:11:16 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tfKa1-003Ffe-35 for pgadmin-support@lists.postgresql.org; Tue, 04 Feb 2025 15:11:16 +0000 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-46788c32a69so73712961cf.2 for ; Tue, 04 Feb 2025 07:11:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738681872; x=1739286672; darn=lists.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=Nt/2ul5hFCKW1shKH+XJoKsT/7YUCE3LbkZqvJWmutI=; b=FmD+2xCNJ0B7pJZGHcPMdIoiGzw9dzZpexOmjegZSYAixuboQ5dO6poPcgIDtyncMS kFKNNZbESEAVT0ECUKIBqC8B9JIc43mrmhi7hlPpI1WTPiC2K16ZHZfGiiAYJnlyzJSY mI68OtSGlu49PQZ1ScWtflw6g3VgTIZrBHcBi/Oah7FQ274uLdqcHgsIGEQcikirrkfF /UxKlih1tbr0EQMsfFYXbYDj1h0rdOG3rKfYc2PdhtyNnBjEM2ifYl83KN8H1AxrCvZq haALlKY0OxpbEMQ21GM6DSqgw3NB/Cih0MLm/bQz3mpY6DfS4agEKtLhVeD7FcIvKCYh i3Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738681872; x=1739286672; 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=Nt/2ul5hFCKW1shKH+XJoKsT/7YUCE3LbkZqvJWmutI=; b=DJOPiLz3i2Z0OKAudxNPDSsly8tLfiaKhcI+B1L8Iv+lMGmupr1wFuxh2nqeWtSHL8 ORWYFs8wnRo8NQp3DJ0W34hqbKiwm/PjNsBDwCXiRQ13MVK6UhH5DE33W6+QiQApe6+r IecdU9vYh64tRQpigP7u2U3nRdIFbfVjaI6f1hp8M8K9hPqz1nxGuQmUWwCEUdGS/Q9J R+/HCcyGcrX0XEjOLMwOL9UE/SB38XYz7FUBFdJ62hIDG+bnC457fkDS5IdQwvNBykwm r9rDNLjgdIKlnbTILibk4RPjFt6/F6C/BpPx5+R8uKq6gXV1zkOkq10EmLCK5CBZmNb6 8qHQ== X-Forwarded-Encrypted: i=1; AJvYcCXu+R2tZ3brtlrXDgVfxjJXdIlky/PwTmW17oDreBKbPGfR4bUiyaPfjCGsnUSg3W+EzmUFP2//DkGwlwiTHJU=@lists.postgresql.org X-Gm-Message-State: AOJu0YxfP7yzuRhpEb80h+GUX/I8clPEsw/JNzgQvlIhOvb4NuIgrJe6 09stRIKrtlCU0os2O6ju6cU9IE53MTYyp0Jqj+pSUBoyUI+YMZuLYKIBzzDanA+ADWveHVwRnYD H4ABHk+SUJaf81LskoWKUG5Ye5HQ= X-Gm-Gg: ASbGnctEC+36bzYJE3bt6UqsPr+f5MSyFc+J+vVsXn2uYxGtb1lJT1Es7NbzBWuBBoh 2ScBm8xPof6Se0ibP4eu5HGli5TZBQQ6K8hZMJkvrF8PbnMPFxxD/4Uc542yI0n3Gu/0UX+lPjg == X-Google-Smtp-Source: AGHT+IETiQDDEINNtjHApSIGAS6SZYzZbB8hQG5TS9xnMI1BW+uuaFRzEgs09YacvOHTNUcU80QWit00XjLQd1dfxCc= X-Received: by 2002:ad4:5de2:0:b0:6d4:27fd:a99d with SMTP id 6a1803df08f44-6e243bf643amr452288076d6.19.1738681872135; Tue, 04 Feb 2025 07:11:12 -0800 (PST) MIME-Version: 1.0 References: <4e7a338-c7d3-e944-20bd-a6e346e175c7@appl-ecosys.com> In-Reply-To: <4e7a338-c7d3-e944-20bd-a6e346e175c7@appl-ecosys.com> From: Tony Shelver Date: Tue, 4 Feb 2025 17:11:00 +0200 X-Gm-Features: AWEUYZkpiRXEM7tWaOsFmAUcFhjFpaIbKXJS1RWm4XdIG7jmCtvBC_isQgzjztc Message-ID: Subject: Re: Lookup tables To: Rich Shepard , "pgadmin-support lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000005dbe2c062d526b4d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005dbe2c062d526b4d Content-Type: text/plain; charset="UTF-8" Seen the suggestions. After decades of playing with the alternatives, I don't overthink it anymore. Pretty much my lookup tables consist of an autogenerated primary key (smallint or integer), a code (name?) and a description as default. If there are a lot of tables fitting a common data format, at times I have consolidated them into a single table with a 'lookup type' column. Depending on application requirements, sometimes there I will provide short and long display names, and a generic description for further clarification, but usually those requirements are overkill. Tony On Tue, 4 Feb 2025 at 16:28, 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? > > TIA, > > Rich > > > --0000000000005dbe2c062d526b4d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Seen the suggestions.

After = decades of playing with the alternatives, I don't overthink it anymore.= =C2=A0 Pretty much my lookup tables consist of an autogenerated primary key= (smallint or integer), a code (name?) and a description as default.=C2=A0 =

If there are a lot of tables fitting a common= =C2=A0 data format, at times I have consolidated them into a single table w= ith a 'lookup type' column.=C2=A0

Dep= ending on application requirements, sometimes there I will provide short an= d long display names, and a generic description for further clarification, = but usually those requirements are overkill.

Tony<= br>

On Tue, 4 Feb 2025 at 16:28, Rich Shepard &l= t;rshepard@appl-ecosys.com&= gt; wrote:
Shoul= d 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?

TIA,

Rich


--0000000000005dbe2c062d526b4d--