Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0tVE-0006JO-Pn for pgsql-admin@arkaria.postgresql.org; Wed, 29 Jul 2020 21:20:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k0tVD-0006ZA-OB for pgsql-admin@arkaria.postgresql.org; Wed, 29 Jul 2020 21:20:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0tVD-0006Z2-Ge for pgsql-admin@lists.postgresql.org; Wed, 29 Jul 2020 21:20:43 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k0tVB-0007Vb-5B for pgsql-admin@lists.postgresql.org; Wed, 29 Jul 2020 21:20:42 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 9ADC65F79F; Wed, 29 Jul 2020 17:20:39 -0400 (EDT) Date: Wed, 29 Jul 2020 17:20:39 -0400 From: Stephen Frost To: Holger Jakobs Cc: pgsql-admin@lists.postgresql.org, "David G. Johnston" , Wells Oliver , pgsql-admin Subject: Re: Re-order columns? Message-ID: <20200729212039.GT12375@tamriel.snowman.net> References: <52AC5CB8-0EBF-4B28-9673-723AC252F619@jakobs.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oW7pVPuX4fxktF3T" Content-Disposition: inline In-Reply-To: <52AC5CB8-0EBF-4B28-9673-723AC252F619@jakobs.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --oW7pVPuX4fxktF3T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Holger Jakobs (holger@jakobs.com) wrote: > Actually, the order of columns is of _no_ importance, since columns are i= dentified by name and not by column number. It's the same as the order of r= ows in a table - undefined (unless you use order by). >=20 > That columns appear to have some kind of order and show in tools with a s= table 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 --oW7pVPuX4fxktF3T Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJfIegnAAoJEO1sijiDR2RVZBkQALCP1EyRfM48frIhzyKdSd2Q mwk2Rm3cuTUFh2uZwJgdyZB5aM60/jNAiobYsNz3/x19pzPQs5trX/F/4+Ej37WC 4/dSewabLZjOuTz7oCW5A9dDyAaZlot1v2A4bWR6jSeLyYWqklHgGNckVNV0avBA 3scgIwRcliLVsNV44IEvI8KYMhEKSXv9xnbegfpxG2qA5R/LeJpDwfkKz0vO9Fzk At1v9kZEc8/W9XVx6tnHwlmOhSuMGOQK4Gll6uZirFIBfvmxr72jT9V9T6cLwZUi DlM96ld0+ouM9M0mkvC1cA3nBHH8EwZH7jUR5z7k5IVyzUgGzqSbhjqmaxBp17x1 0peJBoC5G1iaJLAZQyWrwLZAs8FE5ah8Ql+R5rocA/pqwAW1EMrqH/g0M5v+YG4/ PsvLsdaTqYRvrTFMNJCMH+UinTFuWqIWxace+uC2x6PhyfPdINccfifbly4MYajT 4ZlKH7ysUYc0IVG7G766TNMhTuSp03kzR0X4pG8lDLAAwmMm8zFJohpFbx4/u5Ju ensQoP9EHjqdcDPjn7znXjoad1wgK2anvsSCMywCxMznPIg9aysQ8Wa0Dz2V8p9J 8ZyooaeGd6vIJd8eQhMk1AX43npLzhay89AFi9yMsxsYkHr0Nt05xe5rjII0Apse jlGQ54lBkfqpHrNqbuqI =B3Vr -----END PGP SIGNATURE----- --oW7pVPuX4fxktF3T--