3 ms·
Unsure what you mean. A subset of columns can be selected in any order, across tables. Were you referring to the select order used by "*"?
by narsil 11y ago
Unsure what you mean. A subset of columns can be selected in any order, across tables. Were you referring to the select order used by "*"?
- munro 11y agohttps://wiki.postgresql.org/wiki/Alter_column_position https://wiki.postgresql.org/wiki/Alter_column_position
- pmontra 11y agoYes, I think it's about changing the default presentation order. That could be a feature of the client, psql, pgcli, pgadmin3, but it won't be portable across them unless it's some metadata stored inside the db. Is there any db with that feature? Edit: munro answered that. PostgreSQL does it but it's expensive because it has to rewrite the table.
- kbendyk 11y agoYes, MySQL: ALTER TABLE t1 ADD COLUMN `count` SMALLINT(6) NOT NULL AFTER `lastname`
- kbendyk 11y agoI know, but when I look at a table structure in PgAdmin, all newly added columns appear at the end, of course this can handled properly in select col2, col1... , or by creating a view, but by any other way as this wiki [1] page says. But during development, ability to create logical column order is somehow important to me. [1]https://wiki.postgresql.org/wiki/Alter_column_position https://wiki.postgresql.org/wiki/Alter_column_position