Re: Reordering the fields in a table - Mailing list pgsql-admin

From Wells Oliver
Subject Re: Reordering the fields in a table
Date
Msg-id CAOC+FBUwYnHfskUZKpQHpzS5scdoVREW1k-V344bZ6XR_7ZRNA@mail.gmail.com
Whole thread Raw
In response to Re: Reordering the fields in a table  (Rui DeSousa <rui@crazybean.net>)
Responses Re: Reordering the fields in a table  (Thomas Kellerer <shammat@gmx.net>)
List pgsql-admin
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, and it would be awesome if we could have it in Postgres. Would just love to keep my created_at and modified_at columns at the end of tables without dropping and re-adding them.

Love you guys!

On Fri, Apr 16, 2021 at 3:25 PM Rui DeSousa <rui@crazybean.net> wrote:
You can use a views instead of the application using the tables directly.  The order of the columns can quickly change in a view by dropping and recreating it with the desired order.


On Apr 16, 2021, at 12:15 PM, Campbell, Lance <lance@illinois.edu> 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.
 
Why is this a big deal?
Sixteen years ago when I started working at the University of Illinois I told my boss, “if you give me thirty days I can build a platform that will allow me to cut at least 50% off of the development time of your standard internal web business app.”  I built it.  Today I personally created/manage/develop 17 services that provide over 120 million pages of web content a year.  I can jump into this infrastructure and make a change in an hour or two that would take most people weeks to change.  The one issue that causes me the most grief is the readability of tables.  When you manage 17 services where you are continually tweaking the system you find the tables are very unreadable.  New fields are continually added to the bottom of tables. They are just not readable.
 
The most underappreciated elements in software design is the ongoing need to be able to easily read what you are working with.  Table can really become a mess.  It would be the most amazing enhancement to be able to order the fields of any table with a command.  I know today this is probably not a top priority to most developers and DBAs.  They work in an environment where one person might work on just one or two services.  But as development strategies change over time more people will be developing software faster and faster.  Table field readability will become more important.
 
Thanks,
 
Software Architect
 
217.333.0382
 
 
 
Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure.



--

pgsql-admin by date:

Previous
From: Rui DeSousa
Date:
Subject: Re: Reordering the fields in a table
Next
From: Ron
Date:
Subject: Re: Reordering the fields in a table