public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Ron Johnson <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Lookup tables
Date: Tue, 4 Feb 2025 07:59:09 -0700
Message-ID: <CAKFQuwbhX=61U3nBgrx7483JcGyvuep6sVNYbQ=euo7V0S0wYA@mail.gmail.com> (raw)
In-Reply-To: <CANzqJaD-qFaf_v1fhhs73kfBFuTqkH_qZk1UGEJh95Wz7uF0Ng@mail.gmail.com>
References: <[email protected]>
	<CAKFQuwaPUJCwmf75Uwu1_kLGfOgdt9L+Y-2evudS0RQBNU3-fA@mail.gmail.com>
	<CANzqJaD-qFaf_v1fhhs73kfBFuTqkH_qZk1UGEJh95Wz7uF0Ng@mail.gmail.com>

On Tuesday, February 4, 2025, Ron Johnson <[email protected]> wrote:

> On Tue, Feb 4, 2025 at 9:41 AM David G. Johnston <
> [email protected]> wrote:
>
>> On Tuesday, February 4, 2025, 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?
>>>
>>
>> Most do (have a surrogate PK) since it removes cascading updates
>>
>
> How does a synthetic PK "remove cascading updates"?  Doesn't the decision
> on whether or not to cascade update depend on the ON UPDATE CASCADE clause
> of the FK definition?
>
>
People don’t change synthetic PKs so updates never have to happen on the FK
side.  Labels do get changed, in which case you have to update the FK label
side.

David J.


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: <CAKFQuwbhX=61U3nBgrx7483JcGyvuep6sVNYbQ=euo7V0S0wYA@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