newbie db design question - Mailing list pgsql-general

From Rino Mardo
Subject newbie db design question
Date
Msg-id CAGnasUXDC2R4juLfXrJ=P2fsnPZMt_M6tGdtZ=BEp+0j1=FxMQ@mail.gmail.com
Whole thread Raw
Responses Re: newbie db design question  (Gavan Schneider <list.pg.gavan@pendari.org>)
Re: newbie db design question  ("Ray O'Donnell" <ray@rodonnell.ie>)
List pgsql-general
hello!

really noob question here. i have this experimental database design:

create table products (
product_id serial primary key,
description text,
supplier_id????) ;

create table supplier (
supplier_id serial primary key,
description text) ;


the products table should be linked to the supplier table via "supplier_id" column. i can't find out what would be the data type of supplier_id in table products to do that. i tried

supplier_id serial primary key references supplier

but it won't allow multiple primary key.

how then to proceed? 


regards,




pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: How to drop a subscription inside a stored procedure?
Next
From: Gavan Schneider
Date:
Subject: Re: newbie db design question