Re: [BUGS] BUG #3723: dropping an index that doesn't refer to table's columns

2007-11-08 Thread Tom Lane
"Sam Mason" <[EMAIL PROTECTED]> writes: > I've just discovered that an index that doesn't refer to any of its table's > columns isn't automatically dropped when its table is. I've applied a patch for this: http://archives.postgresql.org/pgsql-committers/2007-11/msg00137.php

Re: [BUGS] BUG #3723: dropping an index that doesn't refer to table's columns

2007-11-06 Thread Sam Mason
On Tue, Nov 06, 2007 at 10:00:43AM -0500, Tom Lane wrote: > Heikki Linnakangas <[EMAIL PROTECTED]> writes: > > Not sure that's enough of a use case to justify not banning it... > > Yeah, it probably is. It's reasonably easy to do this instead: CREATE TABLE foo ( one INTEGER NOT NULL UNIQUE

Re: [BUGS] BUG #3723: dropping an index that doesn't refer to table's columns

2007-11-06 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Please explain how you thought it would help you do that, because >> without some evidence that there's a use-case, I'm inclined to fix it >> as above ... > Note that it was a unique index: Missed that --- obviously need more caf

Re: [BUGS] BUG #3723: dropping an index that doesn't refer to table's columns

2007-11-06 Thread Heikki Linnakangas
Tom Lane wrote: "Sam Mason" <[EMAIL PROTECTED]> writes: p.s. the reason for creating this strange index was to ensure that a maximum of one row was inserted into the table---I can do this different ways for now. Please explain how you thought it would help you do that, because without some evi

Re: [BUGS] BUG #3723: dropping an index that doesn't refer to table's columns

2007-11-06 Thread Tom Lane
"Sam Mason" <[EMAIL PROTECTED]> writes: > I've just discovered that an index that doesn't refer to any of its table's > columns isn't automatically dropped when its table is. A straightforward solution would be to ban such "indexes". > p.s. the reason for creating this strange index was to ensure

[BUGS] BUG #3723: dropping an index that doesn't refer to table's columns

2007-11-06 Thread Sam Mason
The following bug has been logged online: Bug reference: 3723 Logged by: Sam Mason Email address: [EMAIL PROTECTED] PostgreSQL version: 8.2.5 Operating system: Linux Description:dropping an index that doesn't refer to table's columns Details: Hi, I've just discover