pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-admin@lists.postgresql.org
Cc: mike.moening@rtssigns.com
Subject: Re: Reordering the fields in a table
Date: Sat, 17 Apr 2021 17:29:33 +0200
Message-ID: <c51cdb49-d564-b4d9-19dd-895408cf5665@gmx.net> (raw )
In-Reply-To: <035301d73396$8e38b130$aaaa1390$@rtssigns.com >
References: <SN6PR11MB332652C8CA57B27E80EF9FBDDE4C9@SN6PR11MB3326.namprd11.prod.outlook.com >
<50957530-D208-4895-BF58-823B0357E5EA@crazybean.net >
<CAOC+FBUwYnHfskUZKpQHpzS5scdoVREW1k-V344bZ6XR_7ZRNA@mail.gmail.com >
<a6667608-c8cc-1925-ac12-65fe59cb9b2d@gmx.net >
<035301d73396$8e38b130$aaaa1390$@rtssigns.com >
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...
> 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.
view thread (15+ messages) latest in thread
Message-ID: <c51cdb49-d564-b4d9-19dd-895408cf5665@gmx.net>
Permalink: ../c51cdb49-d564-b4d9-19dd-895408cf5665@gmx.net/
Also on: postgresql.org/message-id/c51cdb49-d564-b4d9-19dd-895408cf5665@gmx.net
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: shammat@gmx.net, pgsql-admin@lists.postgresql.org, mike.moening@rtssigns.com
Subject: Re: Reordering the fields in a table
In-Reply-To: <c51cdb49-d564-b4d9-19dd-895408cf5665@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox