SQLite Forum

DROP COLUMN feature with indexes
The use of hyperbole won't make your point any stronger.

> DROP COLUMN should not fail because of such a banality as it makes it impossible to due automatic database manipulation

"Banality"? - Saying "Explicitly" what you want to happen, for EVERY piece of the puzzle, is a base tenet of accurate programming.

"Impossible"? - That's just demonstrably false. Impossible to do it in a lazy way? Maybe, and if so, Good.

There is no substitute for proper and full data statements. I for one would hate if SQLite starts doing magic background things when I try to alter a table in a way that doesn't stroke with the current rest of the schema. I would very much like to know this (by error message) before I go ahead and roll it out to actual production environments<sup>1</sup>.

Lastly - MariaDB/MySQL, great DB as it is, should not be held up as the defacto standard for DB operations, ever. Show PostGres doing it, and you may have a more valid point.

[1] If an entire index exists based on only the column being dropped, I'm happy for that Index to be dropped because the database goes from consistent state to consistent state, and if you do not need the column anymore, you must not need that index anymore. This also means that if I drop the index explicitly before the column (the way I like to do it), everything still works exactly. The moment however there is any index using that column in addition to any other, and I did not explicitly "fix" that index before trying to drop that column, please error out - Loudly and clearly.