On Thu, Dec 24, 2015 at 1:12 PM, John McKown <john.archie.mckown at gmail.com> wrote: > > On Thu, Dec 24, 2015 at 6:49 AM, gunnar <gharms at hiqinvest.nl> wrote: > > > I would like a less limited 'alter table' statement, to be able to drop > > columns and to add columns at a position of my own choice instead of always > > at the end. > > > > > I'm curious as to why. Doing so would, most likely, require rewriting the > entire table. If you want a SELECT * to get the columns in a particular > order, just create a VIEW with the columns in the order in which you want > them. >
I think you focused too much on the ordering issue. He or she may just want a more versatile alter table for convenience. However, I don't know if alter table is used at all in production anywhere (why would it be? the column names and ordering should not be part of the data). They are useful for prototyping because by having a stronger alter table command you don't need to drop and create so many times. In the end, if you spent enough time in the design phase to prepare all your schemas, you should not have to drop (or alter) any of the tables at all. It is a feature, a nice one, but too far from necessary (from my standpoint) to be worthy of the developers' time. -- Bernardo Sulzbach