Re: RE : full featured alter table?
От | Sven Köhler |
---|---|
Тема | Re: RE : full featured alter table? |
Дата | |
Msg-id | bcku6k$hnm$1@main.gmane.org обсуждение исходный текст |
Ответ на | Re: RE : full featured alter table? ("Jim C. Nasby" <jim@nasby.net>) |
Ответы |
Re: RE : full featured alter table?
|
Список | pgsql-general |
>>ALTER TABLE <table> ALTER COLUMN <column> POSITION <int i> >> >>where 1<=i<=number of cols in table and the given column will be moved >>between the (i-1)-th and the i-th column within the table. > > I think that's fine. I think the normal case for doing this will be > after you've added a new column, I think it would be pretty rare to want > to re-order everything in the table. Of course if you did want to > re-order everything in the table, it would be easier to just specify the > list of column names in the new order you'd like to see them in. perhaps we could also think about a ALTER TABLE <table> POSITIONS <column1>,<column2>,... but that is unnessary in my eyes. To issue 15 statements to re-order a complete table shouldn't be a problem. (assuming our table has 15 columns) >>if a admin-tool wants to redefine the order of the columns, it just has >>to submit one command for every column with ascending positions. > > BTW, I've heard a lot of people talking about 'dragging columns around > in select output', and I don't think that's a very good use case for > this. The order of columns should be considered to be part of the table > definition. Changing it should require the same privledges as adding or > dropping a column. If a front-end wants to provide some wiz-bang > interface customization on a per-user basis this isn't the mechanism > that should be used. Of course the described command should require the priviledge for modifying a table. I think we don't want any user to be abled to do that, because that will lead to chaos.
В списке pgsql-general по дате отправления: