| From: | Andreas Pflug <pgadmin(at)pse-consulting(dot)de> |
|---|---|
| To: | Miha Radej <miha(dot)radej(at)siix(dot)com> |
| Cc: | pgadmin-support(at)postgresql(dot)org |
| Subject: | Re: Foreign key creation error |
| Date: | 2003-08-11 16:25:34 |
| Message-ID: | 3F37C37E.3030804@pse-consulting.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgadmin-support |
Miha Radej wrote:
> 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?
Thanks Miha,
quoting missed, patched in CVS. There might be other places where quotes
are missing, please don't hesitate to claim all of them.
Regards,
Andreas
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Montervino, Mariano | 2003-08-11 19:44:09 | I dont´t see database tables |
| Previous Message | Miha Radej | 2003-08-11 13:17:23 | Foreign key creation error |