if you need a multi column fk don't use the "references" keyword on your create table, instead use the "FOREIGN KEY"
keyword for the table, see the "create table" help.
so for example (untested) change
CREATE TABLE appalto (
cod_op int not null references Opere,
cod_co
26 Jun 2005 16:58:50 +0200
Subject: [SQL] multiple PK with a non UNIQUE field
> Sorry, I 'm a beginner of postgres and I found a problem when I was
> passed from MySQL:
> I have to create a referential constraint table APPALTO from a table
> OPERE that as a composed PK(cod_op,cod_
+-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,
| importoint not null, PRIMARY KEY (cod_op,cod_com)
| );
Sorry, I 'm a beginner of postgres and I found a problem when I was
passed from MySQL:
I have to create a referential constraint table APPALTO from a table
OPERE that as a composed PK(cod_op,cod_com) where cod_op ISN'T unique.
in MySQL:
CREATE TABLE opere (
cod_op int NOT NULL ,
cod_co