Re: Lookup tables - Mailing list pgsql-general

From Rob Sargent
Subject Re: Lookup tables
Date
Msg-id 868eea77-7a0c-4fca-b9a3-7a38ffe5087f@gmail.com
Whole thread Raw
In response to Re: Lookup tables  (Ron Johnson <ronljohnsonjr@gmail.com>)
Responses Re: Lookup tables
List pgsql-general



On 2/4/25 10:03, Ron Johnson wrote:
On Tue, Feb 4, 2025 at 11:31 AM Michał Kłeczek <michal@kleczek.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 :)

pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Lookup tables
Next
From: Michał Kłeczek
Date:
Subject: Re: Lookup tables