Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.

Postgres: Reordering table columns.

roger_ackroyd's profile image roger_ackroyd posted 5 years ago in General
The Heidi mechanism for reordering table columns does not work with Postgres (pg).
Looking at the pg forums, it appears that this has always been an issue in pg, and that the only real workaround is to re-create the table or a view using a query with the all of the columns in the required order. Tedious, with a lot of columns. But then again, does it really matter what the column order is?
I think column re-ordering functionality was included in MySQL as an extension.
arucard's profile image arucard posted 5 years ago
In Postgres to change column order is only by recreating table or creating view, just like you mentioned.

There is no way how to change order on created table.

Column order is only useful when you look on data via some grid and you want some consistency.
roger_ackroyd's profile image roger_ackroyd posted 5 years ago
The feature will need to be disabled in some way when using Heidi/Postgres certainly not a pressing issue.


Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.
m.lohse's profile image m.lohse posted 5 years ago
In my opinion there could be two options as a workaround:

1) automatically change the order of columns in data view as it is now possible by hand (with the hint that the real column order @table isn't changed)
2) automatically create a temporary table with the new column order, import data in 'reordered' table, delete/rename (as backup) old table and rename the temporary table to the original name of the source table

It would be great if it would be integrated at some time, but because it is just a comfort feature as Roger already said a solution or feature deactivation when using Postgres is not a pressing issue.
ansgar's profile image ansgar posted 5 years ago
r4837 disables the move up/down buttons for columns in PostgreSQL.

Of course such a temp table approach is possible, but seems like much effort for a feature which is intentionally left away in the PostgreSQL server.
roger_ackroyd's profile image roger_ackroyd posted 5 years ago
I would just leave it at that Ansgar. Its not really important.

Please login to leave a reply, or register at first.