Re: Rearrange Column - Mailing list pgadmin-support

From Dave Caughey
Subject Re: Rearrange Column
Date
Msg-id CAAj2gHyhMPWFW8-ioBGGcqqMQy8O5rqHkvx2MdfT+kjTFtoSdw@mail.gmail.com
Whole thread Raw
In response to Re: Rearrange Column  (richard coleman <rcoleman.ascentgl@gmail.com>)
Responses Re: Rearrange Column  (richard coleman <rcoleman.ascentgl@gmail.com>)
List pgadmin-support
Rik,

Clearly, if you do

SELECT colA, colB FROM MyTable

vs 

SELECT colB, colA FROM MyTable

you'll get the results in a different sequence.  Obviously, using this approach has not manipulated the underlying table (your interpretation of what the OP is asking for), but perhaps the OP's question is that they're wondering if the *reporting* tool (i.e., pgAdmin) could hopefully allow you to rearrange the sequence in which a table's columns are displayed so that when you do a 

SELECT * FROM MyTable

pgAdmin will take care of manipulating the results of the query to *display* the columns in a specified sequence.

Yes, the OP currently has the ability to craft a custom query, e.g., 

SELECT colA, colB, colZ, colT, colC, colQ, colD, colE... 

to get the exact order they want, but it would actually be nice if the reporting tool took care of this for you so you could just specify "SELECT *" and get the columns in the way you want to see them, or, should they be using "View/Edit Rows" pgAdmin would again show the rows in the prefered order.
 
Cheers,
Dave


On Thu, Apr 22, 2021 at 11:01 AM richard coleman <rcoleman.ascentgl@gmail.com> wrote:
Sachin, 

Umm, I hate to be the one to break it to you, but postgreSQL doesn't support rearranging columns in a table, short of dropping them and re-adding them in the desired order.  Since postgreSQL itself doesn't support that, I would be truly amazed to learn that pgAdmin4 managed to accomplish that trick.

If I'm wrong, someone *please* let me know.

rik.

On Thu, Apr 22, 2021 at 9:53 AM Sachin Kumar <sachinkumaras@gmail.com> wrote:
Hi Team,

How can we rearrange the column of PostgreSQL using PGADMIN?

--

Best Regards,
Sachin Kumar

pgadmin-support by date:

Previous
From: richard coleman
Date:
Subject: Re: Rearrange Column
Next
From: richard coleman
Date:
Subject: Re: Rearrange Column