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 1lYB5L-00066V-Lm for pgsql-admin@arkaria.postgresql.org; Sun, 18 Apr 2021 17:19:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lYB5J-0007He-UO for pgsql-admin@arkaria.postgresql.org; Sun, 18 Apr 2021 17:19:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYB5J-0007HX-0g for pgsql-admin@lists.postgresql.org; Sun, 18 Apr 2021 17:19:49 +0000 Received: from [66.111.4.28] (helo=out4-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYB5D-0003fX-HB for pgsql-admin@lists.postgresql.org; Sun, 18 Apr 2021 17:19:48 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 833215C0757; Sun, 18 Apr 2021 13:19:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 18 Apr 2021 13:19:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Vpncm0U6Geo294Akk495Z7D1iX7aULk5fQX1NYx0KKc=; b=Ffv1O+nJ pNImtGaeuSbFSKUuR6QbItgCXUljMuD9mGlFicFxtlaD9IB1AtJZA9Ku5uGqipwO FRllrOjiw/tqKbPydH9HVgG0ogF0Sg4//52o9fxcZeNH7cabqUR9oe16+AVw/i6z WEBpACoPtz8Uds1MxK3wIzraJcKUWbzTdNWr1ZpcvAhNr+ocd9tQRFvKDdMxt101 kUl6LXZ9EHoc4THVitkNNuO2HKBkXRoUFB2F0V4pebdvA4DBUvB8oK8/bwbK38oJ gOH7gqkBpSOl+OVbgHYwvjSFwr5EQMn9JLHeupBR2AGDe4p8ySoB+fIBjIg11EFm fbFK2hpyOy+9ZA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtuddgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesthekredttderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepueffhfejieeuueffgedvudekgeeltdeviedvieeufeei ieevgfetheeufeethedvnecukfhppeduledtrdelhedrudelrdelheenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 9EE5D240057; Sun, 18 Apr 2021 13:19:30 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 3A4C02A0914; Sun, 18 Apr 2021 13:19:27 -0400 (-04) Date: Sun, 18 Apr 2021 13:19:27 -0400 From: Alvaro Herrera To: "Campbell, Lance" Cc: "pgsql-admin@lists.postgresql.org" Subject: Re: Reordering the fields in a table Message-ID: <20210418171927.GA25053@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.28 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Apr-16, Campbell, Lance wrote: > If there is a way to do this please let me know. > > PostgreSQL Request > I would love to see an enhancement to PostgreSQL where administrators > had some way to reorder the fields in their tables. As a software > developer I can easily write a tool to reorder the fields in a table > if there were no foreign keys. But foreign keys throw an enormous > hurdle in my way. Yeah, this feature has been requested many times in the past. It's a tough nut to crack though, which is why it doesn't exist today. I had a patch partially working that did it, but there were a number of areas in the code I couldn't figure out how to change, and after spending much more time than I should have, I abandoned it. I have learned a few more things since then, and maybe if I attempted it now, I could make it work. But I have no plans to work on that at present. It is not impossible, just pretty difficult. -- Álvaro Herrera 39°49'30"S 73°17'W Officer Krupke, what are we to do? Gee, officer Krupke, Krup you! (West Side Story, "Gee, Officer Krupke")