Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Same 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.


Work 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.GP1...


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 "*"?


I 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



Yes, 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.


Yes, MySQL: ALTER TABLE t1 ADD COLUMN `count` SMALLINT(6) NOT NULL AFTER `lastname`


I'd love this too. I wanted materialised views and upsert, so here's hoping :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: