I'm using CockroachDB version 22.1 and have a table with many columns. When I try to run ALTER TABLE ... DROP COLUMN I get the error ERROR: unable to encode table key: <nil>. How can I fix this?
I'm using CockroachDB version 22.1 and have a table with many columns. When I try to run ALTER TABLE ... DROP COLUMN I get the error ERROR: unable to encode table key: <nil>. How can I fix this?
This is a bug that is fixed in patch 22.1.7, so the easiest way to fix this is to upgrade to that version or higher. It manifests when a table has a virtual column as part of its primary key, which most often happens when using a hash-sharded primary key index.