Re: multiple primary keys and reference - Mailing list pgsql-sql

From Achilleus Mantzios
Subject Re: multiple primary keys and reference
Date
Msg-id Pine.LNX.4.44.0206101735410.11308-100000@matrix.gatewaynet.com
Whole thread Raw
In response to multiple primary keys and reference  (Matt <matthew.berardi@weilpublishing.com>)
List pgsql-sql
CREATE TABLE Parts(
PartNo varchar(20) NOT NULL,
machtypesid int4 NOT NULL,
BestPrice decimal(100,2),
Comment text,
PRIMARY KEY (PartNo,machtypesid));

CREATE TABLE MachDefs(
defid serial NOT NULL UNIQUE PRIMARY KEY,
Description text,
PartNo varchar(20),
MachTypeID int4 NOT NULL,
FOREIGN KEY (PartNo,MachTypeID) REFERENCES Parts (PartNo,machtypesid));

-- 
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
tel:    +30-10-8981112
fax:    +30-10-8981877
email:  achill@matrix.gatewaynet.com       mantzios@softlab.ece.ntua.gr



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Efficient DELETE Strategies
Next
From: Stephan Szabo
Date:
Subject: Re: multiple primary keys and reference