More DROP COLUMN

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: More DROP COLUMN
Date: 2002-07-15 03:45:44
Message-ID: GNELIHDDFBOCMGBFGEFOAECECDAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

OK,

DROP COLUMN now seems to work perfectly. All the old test cases that failed
now work fine.

However, I'm not happy with the way dropped columns are renamed. I want to
give them a name that no-one would ever want to use as a legit column name.
I don't like this behaviour:

test=# create table test (a int4, b int4);
CREATE TABLE
test=# alter table test drop a;
ALTER TABLE
test=# select dropped_1 from test;
ERROR: Attribute "dropped_1" not found
test=# alter table test add dropped_1 int4;
ERROR: ALTER TABLE: column name "dropped_1" already exists in table "test"

It's a bit confusing, hey?

What should we do about it?

Maybe I could make ADD COLUMN give this message instead for dropped columns?

ERROR: ALTER TABLE: column name "dropped_1" is a dropped column in table
"test" ... or something ...

We could name the fields "________dropped_x" sort of thing perhaps????

Chris

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-07-15 03:57:11 Re: More DROP COLUMN
Previous Message Rod Taylor 2002-07-15 01:27:11 Re: plpgsql and Schemas