cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

scbuildstmt: add secondary index support for ALTER PK

Open postamar opened this issue 2 years ago • 6 comments

scbuildstmt: add secondary index support for ALTER PK

Previously, we had limited support for ALTER PRIMARY KEY statements in
the declarative schema changer. One of the limitations was that
secondary indexes were not supported. This commit removes this limitation.

Relates to #83932.

Release note (sql change): declarative schema changer support for ALTER
PRIMARY KEY statements now extends to tables which have secondary
indexes.

postamar avatar Aug 15 '22 21:08 postamar

This change is Reviewable

cockroach-teamcity avatar Aug 15 '22 21:08 cockroach-teamcity

cc @ajwerner @ajstorm: this is a work-in-progress to validate that indeed, making ALTER PRIMARY KEY support secondary indexes (and hence UNIQUEs) isn't that big of a deal. So far, it's looking good. My goal is to get tests to pass, then spin off various smaller commits, many of which are straight up bug fixes which don't need to wait for the end of stability period.

postamar avatar Aug 15 '22 21:08 postamar

I'm going to work on this on a more leisurely pace now, since it's not needed for DMS. This is basically blocked on https://github.com/cockroachdb/cockroach/pull/86326 at this point, and the release branch cut of course.

postamar avatar Aug 18 '22 15:08 postamar

This is now ready for review.

postamar avatar Sep 19 '22 21:09 postamar

Though I don’t see what were the comment bugs and how they were fixed.

chengxiong-ruan avatar Sep 22 '22 06:09 chengxiong-ruan

Thanks for taking a look!

Though I don’t see what were the comment bugs and how they were fixed.

This PR originally had two commits, the first was merged into master and release-22.2 about a month ago, the comment bug fixes were in there. The PR description is super stale now, I'll update it. Sorry for the confusion.

postamar avatar Sep 22 '22 12:09 postamar

Thanks for the reviews! I'm going to merge this now, I don't think it will interfere any more with any known or upcoming release/GA blockers.

bors r+

postamar avatar Oct 04 '22 15:10 postamar

Build failed (retrying...):

craig[bot] avatar Oct 04 '22 16:10 craig[bot]

Build succeeded:

craig[bot] avatar Oct 04 '22 17:10 craig[bot]