Bug #616: Alter table add foreign key

Started by PostgreSQL Bugs Listabout 24 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Dirk Jacobs (dirk.jacobs@tuple.be) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
Alter table add foreign key

Long Description
I tried to execute following SQL alter table PRICEGROUP add FOREIGN KEY ("PARENT") REFERENCES "PRICEGROUP" ON DELETE CASCADE

this gives an error ALTER TABLE: column "PARENT" referenced in foreign key constraint does not exist (7) while I'm sure that the column exists and is Non null. I'm using version 7.2 on linux redhat 7.2

Sample Code

No file was uploaded with this report

#2Stefano Reksten
sreksten@sdb.it
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #616: Alter table add foreign key

At 07.24 15/03/02 -0500, you wrote:

I tried to execute following SQL alter table PRICEGROUP add FOREIGN
KEY ("PARENT") REFERENCES "PRICEGROUP" ON DELETE CASCADE

this gives an error ALTER TABLE: column "PARENT" referenced in foreign key
constraint does not exist (7) while I'm sure that the column exists and is
Non null. I'm using version 7.2 on linux redhat 7.2

Hello Dirk,
if you are using double quotes around the column name the name won't be
translated in lowercase; maybe the column name wasn't created this way and
that's why you caon't find it. Try to
alter table pricegroup add foreign key (parent) references pricegroup on
delete cascade
without using double quotes.

Just my 0.02

Ciao,
Stefano