newbie db design question

From: Rino Mardo <rino19ny(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: newbie db design question
Date: 2022-06-11 07:05:15
Message-ID: CAGnasUXDC2R4juLfXrJ=P2fsnPZMt_M6tGdtZ=BEp+0j1=FxMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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,

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gavan Schneider 2022-06-11 08:36:57 Re: newbie db design question
Previous Message Thomas Kellerer 2022-06-10 20:29:42 Re: How to drop a subscription inside a stored procedure?