Skip site navigation (1) Skip section navigation (2)

Dropping column silently kills multi-coumn index (was [ODBC] Error when accessing tables with deleted columns)

From: "Glen Parker" <glenebob(at)nwlink(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Dropping column silently kills multi-coumn index (was [ODBC] Error when accessing tables with deleted columns)
Date: 2003-01-29 22:47:04
Message-ID: 02a501c2c7e8$5d6fe6f0$0b01a8c0@saturn (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-odbc
The other discussion made me try this out:

> So the new dll did take out the delete column.  I
> assume that if you do a drop column that it removes
> the associated index.

(Obviously 7.3.* is involved here...)

I did the following:

oms=# create table __temp1(field1 varchar(10), field2 varchar(10));
CREATE TABLE
oms=# create index __idx_temp1 on __temp1 (field1, field2);
CREATE INDEX
oms=# alter table __temp1 drop column field2;
ALTER TABLE

Note that the ALTER TABLE query succeeded *quietly* and did in fact drop
the index.

Is this intended behavior?  Rather seems like it should refuse to drop
an indexed column, or at least refuse to drop a culumn that's a member
of a multi-culumm index and give notice when an index is dropped.  I
think I'd opt for the never-drop-an-indexed-column approach.

Just an observation :-)

Glen Parker
glenebob(at)nwlink(dot)com



In response to

Responses

pgsql-odbc by date

Next:From: Tom LaneDate: 2003-01-29 23:33:01
Subject: Re: Dropping column silently kills multi-coumn index (was [ODBC] Error when accessing tables with deleted columns)
Previous:From: Michael CalabreseDate: 2003-01-29 22:19:51
Subject: Re: Error when accessing tables with deleted columns

pgsql-general by date

Next:From: John SmithDate: 2003-01-29 23:00:16
Subject: mass import to table with unique index
Previous:From: Nigel J. AndrewsDate: 2003-01-29 22:30:49
Subject: Perl DBI and placeheld values

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group