From: | Ron Johnson <ronljohnsonjr(at)gmail(dot)com> |
---|---|
To: | "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Lookup tables |
Date: | 2025-02-04 17:10:03 |
Message-ID: | CANzqJaCzhHob2s8tfTamwRBWoSZ+KiAcGZB9+k5618jYxLv1XA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-support pgsql-general |
On Tue, Feb 4, 2025 at 12:05 PM Rob Sargent <robjsargent(at)gmail(dot)com> wrote:
>
>
>
> On 2/4/25 10:03, Ron Johnson wrote:
>
> On Tue, Feb 4, 2025 at 11:31 AM Michał Kłeczek <michal(at)kleczek(dot)org> wrote:
> [snip]
>
>>
>> The query to register a visit is:
>> insert into restaurant_visit
>> select $user, current_date, restaurant_id, $rating
>> from restaurant where name = $restaurant_name
>>
>>
>> It is now completely unclear what it means to change the name of the
>> restaurant for already registered visits.
>> Is it still the same restaurant with a different name or a different
>> restaurant?
>>
>> Or let say someone swaps names of two restaurants.
>> That means a user that goes to the same restaurant every day would
>> register visits to two different restaurants!
>>
>
> Valid concerns, which means that you add a new restaurant record when the
> name changes.
>
> And there goes your unique index on phone number :)
>
I don't think I'd ever do that, since phone numbers can get reassigned.
Capital-L Large and old businesses probably don't even have unique indices
on SSN.
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2025-02-04 17:11:18 | Re: Lookup tables |
Previous Message | Michał Kłeczek | 2025-02-04 17:08:56 | Re: Lookup tables |
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2025-02-04 17:11:18 | Re: Lookup tables |
Previous Message | Michał Kłeczek | 2025-02-04 17:08:56 | Re: Lookup tables |