ERROR: UNIQUE constraint matching given keys for referenced table "rl_voltas" not found

From: "Rui Pires" <ruipires(at)zmail(dot)pt>
To: <pgsql-general(at)postgresql(dot)org>
Subject: ERROR: UNIQUE constraint matching given keys for referenced table "rl_voltas" not found
Date: 2003-07-16 22:56:25
Message-ID: 004901c34bed$7c95f2c0$0301a8c0@rui
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi! I'm a beginer in PosrgreSQL, and I have a problem I can't resolve.

The script is the following :

CREATE TABLE RL_RefVoltas(
NVolta SERIAL NOT NULL PRIMARY KEY,
Designacao VARCHAR(15) NOT NULL,
Tipo INT NOT NULL
);

CREATE TABLE RL_Voltas(
NVolta INT NOT NULL,
Data DATE NOT NULL,
Hora TIME NOT NULL,
Matricula VARCHAR(9),
NLitros INT,
PRIMARY KEY (Data,Hora),
foreign key (NVolta)references RL_RefVoltas(NVolta)
);

CREATE TABLE RL_Cisterna(
NVolta INT NOT NULL,
Data DATE NOT NULL,
Hora TIME NOT NULL,
NCist INT NOT NULL PRIMARY KEY, /*1 a 4*/
Acidez INT,
ProvaAlcool BOOL,
TFermentacao TIME,
Fermentacao FLOAT,
foreign key (NVolta, Data, Hora) references RL_Voltas(NVolta, Data, Hora)
);

The result of executing this script is :

ERROR: UNIQUE constraint matching given keys for referenced table "rl_voltas" not found

Anybody can tell me why?

Thanks, and good work.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Terence Chang 2003-07-16 22:57:32 Where is the physical files of database that I just drop?
Previous Message Tom Lane 2003-07-16 22:27:28 Re: Postgresql "FIFO" Tables, How-To ?