Short of dropping the primary key index and re-creating it, how can I alter a composite primary key on a table?
I would love to be able to change the primary key column order and have it re-index and apply immediately in a single statement (so that there is no "downtime" for the primary key).
If it is not possible to do it in a single statement, what is the best way to do it in a single transaction such that the table is not exposed to access for any period of time without a primary key in place?
For example, take a table that has primary key as follows:
PRIMARY KEY (col1, col2, col3, col4)
I want to change the order to (but not add or remove columns):
PRIMARY KEY (col4, col1, col2, col3)