Content Deep Dive
Alter Column Types Without Taking Tables Offline
Blog post from Cockroach Labs
Post Details
Company
Date Published
Author
Richard Cai
Word Count
1,740
Language
English
Hacker News Points
-
Source URL
Summary
CockroachDB has introduced the ability to alter primary keys while in production without downtime. This feature allows developers to change the type of a column (alter column type) without taking tables offline, making it easier to manage database schema changes and evolving requirements. The implementation closely follows a manual process but automates the steps involved. Challenges faced during this implementation include handling two-version invariant object descriptors for reading and writing data. Currently, alter column type only works on columns that are not indexed or constrained, with plans to support more complex schema changes in the future.