drop column name conflict - Mailing list pgsql-hackers

From Joseph Koshakow
Subject drop column name conflict
Date
Msg-id CAAvxfHcB8zPLiTLYc=GqQCM157aRNp7nMD567KCG-dEqVNdAMA@mail.gmail.com
Whole thread Raw
Responses Re: drop column name conflict
List pgsql-hackers
Hi all,

There's a rare edge case in `alter table` that can prevent users from
dropping a column as shown below

    # create table atacc1(a int, "........pg.dropped.1........" int);
    CREATE TABLE
    # alter table atacc1 drop column a;
    ERROR:  duplicate key value violates unique constraint "pg_attribute_relid_attnam_index"
    DETAIL:  Key (attrelid, attname)=(16407, ........pg.dropped.1........) already exists.

It seems a bit silly and unlikely that anyone would ever find
themselves in this scenario, but it also seems easy enough to fix as
shown by the attached patch.

Does anyone think this is worth fixing? If so I can submit it to the
current commitfest.

Thanks,
Joe Koshakow
Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: On disable_cost
Next
From: Tom Lane
Date:
Subject: Re: drop column name conflict