pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedDropping column silently kills multi-coumn index (was [ODBC] Error when accessing tables with deleted columns)
2+ messages / 2 participants
[nested] [flat]
* Dropping column silently kills multi-coumn index (was [ODBC] Error when accessing tables with deleted columns)
@ 2003-01-29 22:47 Glen Parker <glenebob@nwlink.com>
0 siblings, 1 reply; 2+ messages in thread
From: Glen Parker @ 2003-01-29 22:47 UTC (permalink / raw)
To: pgsql-general@postgresql.org
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@nwlink.com
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Dropping column silently kills multi-coumn index (was [ODBC] Error when accessing tables with deleted columns)
@ 2003-01-29 23:33 Tom Lane <tgl@sss.pgh.pa.us>
parent: Glen Parker <glenebob@nwlink.com>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2003-01-29 23:33 UTC (permalink / raw)
To: Glen Parker <glenebob@nwlink.com>; +Cc: pgsql-general@postgresql.org
"Glen Parker" <glenebob@nwlink.com> writes:
> Note that the ALTER TABLE query succeeded *quietly* and did in fact drop
> the index.
If indexes require a CASCADE to be dropped by DROP COLUMN, then DROP
TABLE on an indexed table would also require CASCADE. Does that seem
like a good idea?
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-01-29 23:33 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-29 22:47 Dropping column silently kills multi-coumn index (was [ODBC] Error when accessing tables with deleted columns) Glen Parker <glenebob@nwlink.com>
2003-01-29 23:33 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox