Publication date: March 6, 2023
Description
While executing ALTER TABLE DROP COLUMN
on a column used in a partial index, all DML statements referencing the table fail with an error during the delete-only phase of the ALTER
, which can last several hours for large tables. This includes SELECT
, INSERT
, UPSERT
, UPDATE
, and DELETE
statements.
This problem exists in all versions of CockroachDB since the introduction of partial indexes in v20.2.0.
Statement
This is resolved in CockroachDB by #97372, which disallows dropping columns that are referenced by a partial index.
This fix has been applied to maintenance releases of CockroachDB v22.1.16 and v22.2.6).
This public issue is tracked by #96924.
Mitigation
Users can avoid the issue by dropping any partial indexes using the column before dropping the column.
Users of CockroachDB v21.2.0 through v22.1.15 and v22.2.0 through v22.2.5 are encouraged to upgrade to v22.1.16, v22.2.6, or a later version.
Impact
When executing ALTER TABLE DROP COLUMN
of a column used in a partial index, all DML statements referencing the table fail with an error during the delete-only phase. DML statements not referencing the table are not affected.
Questions about any technical alert can be directed to our support team.