If you could reorder columns, then you could do this (and more), cause you could just add a column to the end and then immediately reorder it to where you want it.
makes it easier to read when related columns are next to each other. Or are in some kind of grouping.
An easy scenario to image is you start with 1 metric column, say column 2 of 10. And then some years later you come up with another metric, and you want to see how it compares to your original metric. If it's in column 3, you can shift your eyes back and forth between them quite easily. If you have to cross 8 unrelated columns, then it's much less efficient for you to process the data.
And for the sake of argument, lets say that those 8 columns contain secondary information and the query takes some time to run, so simply omitting the other information also creates a big hassle.
So then I have a table I never use, and a view that is virtually identical to the table I never use. And they both have to have names, which ideally describe them, but can't be the same.
I mean it works, but it doesn't feel like a good solution to me cause 2 things that apparently do the same thing is sure to cause confusion.
When my users are using my software and they tell me about these things they do to work around things my software does, I take that as an indication that my software needs to change.
Edit: Huh, interesting. I literally never use a GUI with postgresql, so it never even occurred to me. Fair enough.
It's even more relevant in the CLI, where you don't get things like expandable cells or could potentially have a post query feature to rearrange things (though idk if any sql gui actually lets you do that).
Wrapping is a huge issue too. Imagine you have a table that stores reddit comments. There's a bunch of relevant fields, the id36, the username of who posted it, the body, when it was made, etc. If one of your middle fields has a very long width or has new lines in it, then everything after it can't be aligned and when one column is taking up 2-20 rows, it's really hard to read, because it's not very clear where one row starts and the next ends, or if it's in the middle of another column.
At least with a gui, you don't need to have all of the information being shown on the screen all the time, and you can simply show an excerpt of a really long cell, and have it expand on click etc.
When you query tables in a GUI tool the columns are ordered in the natural order of the table. Any new columns are at the end with Postgres. It's really annoying. Other databases let you modify the order.
created/updated/deleted at should always (imo) be at the end. If I see those columns I assume there's no more. I've found I miss columns when they're "hidden" after that.
View all comments
32
u/X-lem 8d ago
Can we add a new column after another column yet?