pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org,"David G. Johnston" <david.g.johnston@gmail.com>
To: Wells Oliver <wells.oliver@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Re-order columns?
Date: Wed, 29 Jul 2020 22:50:37 +0200
Message-ID: <52AC5CB8-0EBF-4B28-9673-723AC252F619@jakobs.com> (raw)
In-Reply-To: <CAKFQuwYQbDVoKMT=Eem92F0xitXNgM_iCDMtzjChyT3pAi9N5w@mail.gmail.com>
References: <CAOC+FBUm=b0a2j0h=qDSCqVwO8yWm2fgYSwH2=StVsia4eYLMQ@mail.gmail.com>
	<CAKFQuwYQbDVoKMT=Eem92F0xitXNgM_iCDMtzjChyT3pAi9N5w@mail.gmail.com>

Actually, the order of columns is of _no_ importance, since columns are identified by name and not by column number. It's the same as the order of rows in a table - undefined (unless you use order by).

That columns appear to have some kind of order and show in tools with a stable order has technical reasons and is not rooted in relational theory.

Of you prefer a different order, use a view.


Am 29. Juli 2020 22:45:06 MESZ schrieb "David G. Johnston" <david.g.johnston@gmail.com>:
>On Wednesday, July 29, 2020, Wells Oliver <wells.oliver@gmail.com>
>wrote:
>
>> I know this kind of dumb, but is there a way to re-order columns? You
>> know, you have your awesome table all defined, your favorite
>modified_at
>> column at the end where you like it, then some guy comes along and is
>like
>> "oh let's add X Y and Z" and your OCD really really really wants the
>> modified_at col at the end, and blowing away/re-populating the table
>takes
>> way too long
>>
>
>There is not.  Every so often this gets looked at but has yet to result
>in
>a commit.
>
>David J.

-- 
Holger Jakobs, Bergisch Gladbach
+49 178 9759012
- sent from mobile, therefore short -

view thread (14+ messages)  latest in thread

Message-ID: <52AC5CB8-0EBF-4B28-9673-723AC252F619@jakobs.com>
Permalink:  ../52AC5CB8-0EBF-4B28-9673-723AC252F619@jakobs.com/
Also on:    postgresql.org/message-id/52AC5CB8-0EBF-4B28-9673-723AC252F619@jakobs.com

 · 

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: holger@jakobs.com, david.g.johnston@gmail.com, wells.oliver@gmail.com
  Subject: Re: Re-order columns?
  In-Reply-To: <52AC5CB8-0EBF-4B28-9673-723AC252F619@jakobs.com>

* 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