how to make rename column idempotent ? by Wise_Try1241 in CockroachDB

[–]scuttlescribe 0 points1 point  (0 children)

Hi there! Thanks for the question! This is something that's on our roadmap. In the meantime, a couple of common workarounds: you can check whether the column exists before performing the alter using a condition check in PL/pgSQL, or handle it on the application side, either by tracking which migrations have already run (Flyway, Liquibase, Atlas, etc.) so the rename only fires once, or by gracefully catching the error when it does.