Question

Is there any way to change the order of the columns phppgadmin views when browsing tables without having to change the underlying db?

I have a few columns that I want seperated by heaps of unimportant ones and then a few more important ones at the end. The problem is that the important ones on the right are way of the screen so its hard to check visually if data has been inputed correctly.

Cheers

Was it helpful?

Solution

I know little about Phppgadmin, but I think that you can't do that - customize the order in which the columns are displayed- it's determined by the DB schema.

And, even if you wanted to do that in the underlying db, it would be not easy, Postgresql does not support column reordering: you would need to dump-edit-restore the table, or do a SELECT ... INTO ... followed by a RENAME and DROP TABLE; but you would need to fix manually dependecies in this case (views, FK, sequences, etc).

It's true that the column order in a database has little relevance from the pure relational point of view, but in practical use it's nice to have related fields together, it helps when browsing.

One alternative (probably unsastifactory) is to define a VIEW which mirrors a table, with the columns reordered, and use that for browsing. It would not be useful for updating, though... among other shortcomings.

OTHER TIPS

as mentioned before you cant alter the position of the columns in phppgadmin, however there are some work arounds. basic work arounds can be found here: workarounds. these work arounds basically consist of creating the tables in the correct order then moving the data, bit of a pain but still worth a look.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top