problems with CREATE TABLE

Started by Martin A. Marquesover 25 years ago2 messagesgeneral
Jump to latest
#1Martin A. Marques
martin@math.unl.edu.ar

I'm on Potsgres 7.0.2 on Solaris, and I get a parse error when I try to
create this table:

CREATE TABLE ubicacion (
id SERIAL,
id_palabra INT,
tabla INT NOT NULL,
id_row INT NOT NULL,
CONSTRAINT "fk_ubic_id_palabra" FOREIGN KEY id_palabra
REFERENCES palabras ("pid"),
CONSTRAINT "fk_tabla_s" FOREIGN KEY tabla REFERENCES tablas
("id_tabla")
);

OK, the table palabras and the table tablas exist, as they also have those
columnas to reference to. The error I get is:

ERROR: parser: parse error at or near "id_palabra"

If you need the CREATE TABLE statements of the other tables I can send them.

Saludos... :-)

--
"And I'm happy, because you make me feel good, about me." - Melvin Udall
-----------------------------------------------------------------
Mart�n Marqu�s email: martin@math.unl.edu.ar
Santa Fe - Argentina http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Martin A. Marques (#1)
Re: problems with CREATE TABLE

Martin A. Marques writes:

CREATE TABLE ubicacion (
id SERIAL,
id_palabra INT,
tabla INT NOT NULL,
id_row INT NOT NULL,
CONSTRAINT "fk_ubic_id_palabra" FOREIGN KEY id_palabra
REFERENCES palabras ("pid"),

... FOREIGN KEY (id_palabra) REFERENCES ...

CONSTRAINT "fk_tabla_s" FOREIGN KEY tabla REFERENCES tablas
("id_tabla")
);

ERROR: parser: parse error at or near "id_palabra"

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/