Skip site navigation (1) Skip section navigation (2)

Foreign key creation error

From: Miha Radej <miha(dot)radej(at)siix(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: Foreign key creation error
Date: 2003-08-11 13:17:23
Message-ID: 5.2.0.9.0.20030811143732.00b6bdf0@mail.over.net (view raw or flat)
Thread:
Lists: pgadmin-support
Hi!

I've tried creating in pgAdmin3. The generated SQL output was

CREATE TABLE public."KOMENTARJI"
(
    "idKomentarja" bigserial NOT NULL,
    "idRecepta" int8 NOT NULL,
    "idUporabnika" int8 NOT NULL,
    "Komentar" text NOT NULL,
    "DatumVnosa" text NOT NULL,
    "IPVnosa" text NOT NULL,
    CONSTRAINT "fkey_KOMENTAR_RECEPT" FOREIGN KEY (idRecepta) REFERENCES 
"RECEPTI" (idRecepta)    ON UPDATE RESTRICT ON DELETE RESTRICT,
    CONSTRAINT "fkey_KOMENTAR_UPORABNIK" FOREIGN KEY (idUporabnika) 
REFERENCES "UPORABNIKI" (idUporabnika)    ON UPDATE RESTRICT ON DELETE 
RESTRICT,
    CONSTRAINT "pkey_KOMENTARJI" PRIMARY KEY ("idKomentarja")
) WITHOUT OIDS;

When hitting OK pgAdmin reported an error. I tried manually entering this 
query by adding quotes to column names in the foreign key constraints:

CREATE TABLE public."KOMENTARJI"
(
    "idKomentarja" bigserial NOT NULL,
    "idRecepta" int8 NOT NULL,
    "idUporabnika" int8 NOT NULL,
    "Komentar" text NOT NULL,
    "DatumVnosa" text NOT NULL,
    "IPVnosa" text NOT NULL,
    CONSTRAINT "fkey_KOMENTAR_RECEPT" FOREIGN KEY ("idRecepta") REFERENCES 
"RECEPTI" ("idRecepta")    ON UPDATE RESTRICT ON DELETE RESTRICT,
    CONSTRAINT "fkey_KOMENTAR_UPORABNIK" FOREIGN KEY ("idUporabnika") 
REFERENCES "UPORABNIKI" ("idUporabnika")    ON UPDATE RESTRICT ON DELETE 
RESTRICT,
    CONSTRAINT "pkey_KOMENTARJI" PRIMARY KEY ("idKomentarja")
) WITHOUT OIDS;

and the query was accepted, the table and everything created.

Did I do something wrong when creating the table and foreign keys? Or is 
there some other reason that the column names in foreign keys weren't 
wrapped with double quotes?

I am running Windows 2000, sp3, and I just today downloaded pgAdmin3 (win32 
binary). I've been using English language.

Other than that it seems to be working great!


--
Regards,
Miha 



Responses

pgadmin-support by date

Next:From: Andreas PflugDate: 2003-08-11 16:25:34
Subject: Re: Foreign key creation error
Previous:From: p_designDate: 2003-08-11 11:00:27
Subject: Fwd: pgadmin additional info

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group