Re: Lookup tables

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Lookup tables
Date: 2025-02-04 14:46:41
Message-ID: c4fcf2f3-dda-e52e-4140-e16f7e95a580@appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-general

On Tue, 4 Feb 2025, Rob Sargent wrote:

> I would definitely add an Id for each of the looked up values. The code
> can use the Id (for the join or lookup) and the string value can safely be
> changed (think typo) without ripple effect.  It also prevents other tables
> from referencing the lookup witrh bogus values (those not in the lookup
> table)
>
> Unless your lookup tables are huge I would create a new table matching
> your current table but with an identity column and load from you original
> table.
> https://www.postgresql.org/docs/current/ddl-identity-columns.html

Thanks, Rob. Each lookup table has only a very few rows,

I'll make new tables today.

Regards,

Rich

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Rich Shepard 2025-02-04 14:47:48 Re: Lookup tables
Previous Message David G. Johnston 2025-02-04 14:41:37 Re: Lookup tables

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2025-02-04 14:47:48 Re: Lookup tables
Previous Message David G. Johnston 2025-02-04 14:41:37 Re: Lookup tables