3 ms·
I know it doesn't matter to some developers out there, but for me, the only thing left is the ability to add a column after another one. Even if it's only logic
by kbendyk 11y ago
I know it doesn't matter to some developers out there, but for me, the only thing left is the ability to add a column after another one. Even if it's only logical order, it's easier for me to read a table structure when fields are ordered nicely.
- narsil 11y agoUnsure 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
- leftnode 11y agoSame thing here, I would love this feature. I like to make my tables have a common structure: id created_at updated_at status fkey1_id fkey2_id fkey3_id date_field1 date_field2 column1 column2 column3 Being able to add a new foreign key column with the "rest" of them would be awesome.
- corford 11y agoI'd love this too. I wanted materialised views and upsert, so here's hoping :)
- jeltz 11y agoWork on this started recently, but since it is an open source project there is no way to know if this will make it to 9.6 or not (the work was start too late to get into 9.5). http://www.postgresql.org/message-id/flat/20141209174146.GP1768@alvh.no-ip.org http://www.postgresql.org/message-id/flat/20141209174146.GP1...