1. adding a new nullable column of type bigint. 2. copying the primary key into this field in small batches 3. Once done. rename the primary column and new column, to swap them 4. attach the sequence to the new column and deattach it from the old column 5. Make new column NON NULL (Not sure if this will block) 6. Remove primary key from old column, make new column to be the primary key (I fear this will block to create the index, but I guess not nearly as long as ALTER COLUMN type) 7. Delete old column.
This could be prevented, if this would be done in a non blocking way by the database system itself, so I hope this is already implemented or at least on the roadmap. Any thoughts?
Hye Torge,
I was recently involved with such a change. See this thread[1] for discussion. In particular, it touches on point 5, where you ask what's blocking. Hope it helps.