Re: multiple PK with a non UNIQUE field

From: Mathieu Arnold <mat(at)mat(dot)cc>
To: davide <site(dot)webmaster(at)email(dot)it>, pgsql-sql(at)postgresql(dot)org
Subject: Re: multiple PK with a non UNIQUE field
Date: 2005-06-26 15:14:20
Message-ID: 416F186D0B67C67BDFA439FE@cc-171.int.t-online.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

+-le 26/06/2005 16:58 +0200, davide écrivait :
| CREATE TABLE appalto (
| cod_op int not null references Opere,
| cod_com int not null references Opere,
| scadenza date not null,
| importo int not null, PRIMARY KEY (cod_op,cod_com)
| );

You have to :
CREATE TABLE appalto (
cod_op int not null,
cod_com int not null,
scadenza date not null,
importo int not null,
PRIMARY KEY (cod_op,cod_com),
foreign key (cod_op,cod_com) references opere (cod_op,cod_com)
);

--
Mathieu Arnold

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jim Buttafuoco 2005-06-26 15:19:45 Re: multiple PK with a non UNIQUE field
Previous Message davide 2005-06-26 14:58:50 multiple PK with a non UNIQUE field