Re: Making Complicated References - Mailing list pgsql-general

From Daniel R. Anderson
Subject Re: Making Complicated References
Date
Msg-id 1049067807.496.12.camel@ny-chicagost2d-72.buf.adelphia.net
Whole thread Raw
In response to Re: Making Complicated References  (Dennis Gearon <gearond@cvc.net>)
Responses Re: Making Complicated References  (merlyn@stonehenge.com (Randal L. Schwartz))
List pgsql-general
<snip>
> How about some table definitions?
</snip>

below is a simplified version:

CREATE TABLE products
(
    product_key    varchar(80),    primary key,
    attribute_1    varchar(80),    not null,
    attribute_2    varchar(80),     not null,
    ...
    attribute_n    varchar(80)    not null
);

CREATE TABLE sizes
(
    product_key    varchar(80),    references products,
    packaging_type    varchar(80),    -- i.e. Bags
                    -- i.e. Drums
                    -- i.e. Bottles
    weight        varchar(80)    -- i.e. 5lbs
                    -- i.e. 1 gallon
                    -- i.e. 8 oz.
);

So now I want to create a table called orders.  This table must
reference the item_number in products AND reference the packaging type
and weight so that if somebody orders stearic acid they can't select a
4.3 lb bag if we only sell 50lb bags.

This is what I mean by ¨complicated references¨

Thanks in advance,

-Dan


pgsql-general by date:

Previous
From: Richard Welty
Date:
Subject: redhat 7.1 upgrade
Next
From: "Daniel R. Anderson"
Date:
Subject: Re: redhat 7.1 upgrade