Re: confused by select. - Mailing list pgsql-sql

From Antoine Reid
Subject Re: confused by select.
Date
Msg-id 20000707153223.A22141@inertia.home.kernel-panic.net
Whole thread Raw
In response to Re: confused by select.  (Patrick Jacquot <patrick.jacquot@anpe.fr>)
List pgsql-sql
On Fri, Jul 07, 2000 at 11:44:30AM +0200, Patrick Jacquot wrote:
[snip]
> 
> usually many-to-many relationships are handled by a third table, like this:
> 
> create table items (item_id,...)
> create table customers (customer_id, ...)
> create table orders (customer_id, item_id, quantity_orderered)

Hi!  In real life situations, I can only see one possible problem with that.
Let's say you have a product in stock, for a long period of time, and at some
point, you need to change the description of the product... Now what happens
when you look at your old invoices?  They show up with the new description..

What if you need to delete a product? :)
What if the shipping address changes?

I have found, as a requirement in many of my projects, that we be able to view 
invoices/orders /exactly/ like they were..  It involves a different set of
tables, one for the 'open' orders, inventory, etc and another set of tables, 
that are populated for every invoice. (Yes, that means lots of duplication..)

> 
> Hoping it may help
> 
> Patrick JACQUOT
> 
just my 1/50$ CDN
(for what it's worth nowadays...)

Antoine Reid




pgsql-sql by date:

Previous
From: "sandis"
Date:
Subject: date comparision
Next
From: Peter Eisentraut
Date:
Subject: Re: Altnerate Column Return Names