Re: Lookup tables

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Lookup tables
Date: 2025-02-04 15:04:54
Message-ID: CAKFQuwYpoUxB8je87ozcajt2L7BrNtN9j9mTfomU6gw=jsKNNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-general

On Tuesday, February 4, 2025, Ron Johnson <ronljohnsonjr(at)gmail(dot)com> wrote:

> On Tue, Feb 4, 2025 at 9:28 AM Rich Shepard <rshepard(at)appl-ecosys(dot)com>
> 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 lookup
> 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.

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Ron Johnson 2025-02-04 15:05:20 Re: Lookup tables
Previous Message Ron Johnson 2025-02-04 14:59:48 Re: Lookup tables

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2025-02-04 15:05:20 Re: Lookup tables
Previous Message Ron Johnson 2025-02-04 14:59:48 Re: Lookup tables