Re: Reordering the fields in a table

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Reordering the fields in a table
Date: 2021-04-18 20:16:34
Message-ID: 519ffa9f26f607e8154b012f0ee323be72512da2.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 2021-04-16 at 22:33 -0500, Ron wrote:
> On 4/16/21 2:54 PM, Laurenz Albe wrote:
> > On Fri, 2021-04-16 at 16:15 +0000, Campbell, Lance wrote:
> > > I would love to see an enhancement to PostgreSQL where administrators had some way to reorder the fields in their tables.
> >
> > There is a misconception here.
> > Database tables are not designed for human consumption.
>
> Rubbish. Database tables are designed by humans to store data that humans
> care about.

I think you deliberately misunderstand me.
A database is not a GUI to render data.

> > If you want to present your table data in a readable format, you need a front end application.
> > Arranging table columns is the job of such a tool.
>
> Adding "ALTER TABLE MOVE COLUMN ... BEFORE/AFTER COLUMN ..." is pretty
> trivial, requiring "just another table", which stores the physical order of
> the columns, and also the order in which they are presented to the "user
> layer". I know this because such a feature was implemented 15+ years ago in
> Rdb/VMS.

It is *not* trivial.

If you want a solution and are not just trolling, why don't you use views?

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Il Mimo di Creta 2021-04-19 07:03:07 Most proper partitioning form on an integer column
Previous Message Alvaro Herrera 2021-04-18 17:19:27 Re: Reordering the fields in a table