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 14:59:09 |
Message-ID: | CAKFQuwbhX=61U3nBgrx7483JcGyvuep6sVNYbQ=euo7V0S0wYA@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:41 AM David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
>> On Tuesday, February 4, 2025, Rich Shepard <rshepard(at)appl-ecosys(dot)com>
>> 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Ron Johnson | 2025-02-04 14:59:48 | Re: Lookup tables |
Previous Message | Ron Johnson | 2025-02-04 14:56:26 | Re: Lookup tables |
From | Date | Subject | |
---|---|---|---|
Next Message | Ron Johnson | 2025-02-04 14:59:48 | Re: Lookup tables |
Previous Message | Ron Johnson | 2025-02-04 14:56:26 | Re: Lookup tables |