From: Stephen Frost <sfrost@snowman.net>
To: Holger Jakobs <holger@jakobs.com>
Cc: pgsql-admin@lists.postgresql.org, "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Wells Oliver <wells.oliver@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Re-order columns?
Date: Wed, 29 Jul 2020 17:20:39 -0400
Message-ID: <20200729212039.GT12375@tamriel.snowman.net> (raw)
In-Reply-To: <52AC5CB8-0EBF-4B28-9673-723AC252F619@jakobs.com>
References: <CAOC+FBUm=b0a2j0h=qDSCqVwO8yWm2fgYSwH2=StVsia4eYLMQ@mail.gmail.com>
<CAKFQuwYQbDVoKMT=Eem92F0xitXNgM_iCDMtzjChyT3pAi9N5w@mail.gmail.com>
<52AC5CB8-0EBF-4B28-9673-723AC252F619@jakobs.com>
Greetings,
* Holger Jakobs (holger@jakobs.com) wrote:
> 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.
There's very practical reasons to think about the ordering of columns,
at least in PostgreSQL- you can end up creating holes in your row if you
order the columns in the wrong way and that can lead to wasted space.
There was a patch floating around to allow re-ordering, which would also
then allow us to re-order the row underneath to avoid wasting space (as
much as possible, anyway) which would be really rather nice, but sadly
it didn't get enough push on it to make it happen.
Thanks,
Stephen
Attachments:
[application/pgp-signature] signature.asc (818B, ../20200729212039.GT12375@tamriel.snowman.net/2-signature.asc)
download
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: sfrost@snowman.net, holger@jakobs.com, david.g.johnston@gmail.com, wells.oliver@gmail.com
Subject: Re: Re-order columns?
In-Reply-To: <20200729212039.GT12375@tamriel.snowman.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