public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tony Shelver <[email protected]>
To: Rich Shepard <[email protected]>
To: pgadmin-support lists.postgresql.org <[email protected]>
Subject: Re: Lookup tables
Date: Tue, 4 Feb 2025 17:11:00 +0200
Message-ID: <CAG0dhZBNiGSQ_hiRcMPP27z_1ZEiNadcgv0Ui5e34o26FQEv-A@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

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 <[email protected]> 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
>
>
>


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Lookup tables
  In-Reply-To: <CAG0dhZBNiGSQ_hiRcMPP27z_1ZEiNadcgv0Ui5e34o26FQEv-A@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox