sqlmesh icon indicating copy to clipboard operation
sqlmesh copied to clipboard

[Redshift] Check Distkey and Sortkey before Altering Table

Open eakmanrq opened this issue 1 year ago • 0 comments

Due to Redshift's auto table optimization it is possible that a user would have a forward-only table that needs to have a column dropped that is part of the distkey or sortkey. Therefore before performing alter operations on Redshift we should check if we are dropping a distkey/sortkey and if so we should change the distkey/sortkey to auto and then alter.

In the case where there is a type change we should test but it would likely involve changing to auto and then changing it back once done.

eakmanrq avatar Dec 13 '23 20:12 eakmanrq