Settings

Theme

Reordering Columns in PostgreSQL

2 points by HNBRN 3 years ago · 9 comments · 1 min read


This is kind of a stupid question but I see lot of people here recommend postgresql so I decided to give it a try.

I stumbled upon the fact that it's not possible to rearrange columns ordering.

Is this not too much of a constraint ? I mean what's the workaround for eg for the analysts using it daily ? Columns just pile at the end of every table without any consistency ?

Sorry for the broken english (french)

rangerelf 3 years ago

The order of the columns in your table creation statements is irrelevant to the order of how the columns return to you in your queries.

Your select statement specified the order of your result columns in your result set. Your visualization tools should have the option to reorder the displayed columns to your liking or need.

sargstuff 3 years ago

Alternate interpretation of explaination:

https://www.quackit.com/sql/tutorial/sql_order_by.cfm

https://www.tutorialsteacher.com/sqlserver/orderby

https://www.tutorialsteacher.com/sqlserver/orderby

wcorrales 3 years ago

https://github.com/TriangleCommunications/reorder-table-colu...

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection