bug in 7.0.3 related to triggers and field rename

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: bug in 7.0.3 related to triggers and field rename
Date: 2001-04-13 11:24:23
Message-ID: 200104131124.f3DBONR41908@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Giuseppe Sacco (eppesuigoccas(at)libero(dot)it) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
bug in 7.0.3 related to triggers and field rename

Long Description
Hi,
I probably found a bug in PostgreSQL 7.0.3 running on Debian GNU/Linux potato. Kernel 2.2.19.

The problem is that I created a foreign key from table two to table one. After that I renamed the field target of the relation (on table one) expecting PostgreSQL to raise an error since the field is a target. Otherwise I espected an automatic change of the foreign key relation.

Instead PostgreSQL accept the field rename but then (of course) the foreign key trigger gives an error.

Sample Code
elmer3=# create table one (id int4 not null primary key);
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'one_pkey' for table 'one'
CREATE
elmer3=# create table two (one int4 not null);
CREATE
elmer3=# alter table two add foreign key(one) references one;
NOTICE: ALTER TABLE ... ADD CONSTRAINT will create implicit trigger(s) for FOREIGN KEY check(s)
CREATE
elmer3=# alter table one rename id to newid;
ALTER
elmer3=# insert into one values (4);
INSERT 79419 1
elmer3=# insert into two values (5);
ERROR: constraint <unnamed>: table one does not have an attribute id
elmer3=#

No file was uploaded with this report

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-04-13 15:59:58 Re: error creating table that worked under 7.0.3
Previous Message Antonio Sindona 2001-04-13 11:08:01 Compiling PG 7.0.3 undex HP-UX 10.20