Re: Reordering the fields in a table

Поиск
Список
Период
Сортировка
Искать
От
Thomas Kellerer
Тема
Re: Reordering the fields in a table
Дата
Msg-id
c51cdb49-d564-b4d9-19dd-895408cf5665@gmx.net
Ответ на
RE: Reordering the fields in a table (mike.moening@rtssigns.com)
Список
Дерево обсуждения
Reordering the fields in a table "Campbell, Lance" <lance@illinois.edu>
Re: Reordering the fields in a table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Reordering the fields in a table Rui DeSousa <rui@crazybean.net>
Re: Reordering the fields in a table Wells Oliver <wells.oliver@gmail.com>
Re: Reordering the fields in a table Thomas Kellerer <shammat@gmx.net>
RE: Reordering the fields in a table mike.moening@rtssigns.com
Re: Reordering the fields in a table Thomas Kellerer <shammat@gmx.net>
Re: Reordering the fields in a table Google FezaCakir <fezacakir@gmail.com>
Re: Reordering the fields in a table MichaelDBA <MichaelDBA@sqlexec.com>
Re: Reordering the fields in a table Laurenz Albe <laurenz.albe@cybertec.at>
Re: Reordering the fields in a table MichaelDBA <MichaelDBA@sqlexec.com>
Re: Reordering the fields in a table Ron <ronljohnsonjr@gmail.com>
Re: Reordering the fields in a table Laurenz Albe <laurenz.albe@cybertec.at>
Re: Reordering the fields in a table "David G. Johnston" <david.g.johnston@gmail.com>
Re: Reordering the fields in a table Tom Lane <tgl@sss.pgh.pa.us>
mike.moening@rtssigns.com schrieb am 17.04.2021 um 16:32:
> MS SQL Server allows this too.  I do it all the time.

SSMS will do that for you by dropping and re-creating the table (and all related foreign keys)

But there is no SQL statement to do it.

See e.g. the manual:

https://docs.microsoft.com/en-us/sql/relational-databases/tables/change-column-order-in-a-table?view=sql-server-ver15#TsqlProcedure

>  To change the column order
>  This task is not supported using Transact-SQL statements.


> Wells Oliver schrieb am 17.04.2021 um 00:28:
>> If it helps the cause, I would love this too, in addition to having
>> the ability to ALTER TABLE ... ADD COLUMN with the ability to specify
>> where in the column order. This ends up being a bigger frustration for
>> a lot of people than it should be, and maybe it's a touch of OCD, but
>> most RDBMS packages allow this
>
> "Most" seems a bit of a stretch.
> To my knowledge it's only supported in MySQL, Firebird and Informix.
>
> You can't do this in Oracle, SQL Server, DB2, Teradata, Ingres, Vertica or SAP Hana.




В списке pgsql-admin по дате отправления
От: David G. Johnston
Дата:
От: Tom Lane
Дата:
FAQ