Ayush
Ayush

Reputation: 121

GCP: Can we modify primary key of an existing table in spanner

I want to modify Primary key of an existing Table in Spanner from Col1 to combination of Col1 and Col2. Is it possible to do it in Spanner?

This option is not available in Console. Maybe it can be done with a script!

Upvotes: 3

Views: 4888

Answers (2)

Ayush
Ayush

Reputation: 121

GCP Team responded below:

Upvotes: 1

PrecariousJimi
PrecariousJimi

Reputation: 1533

The keys of a table can't change; you can't add a key column to an existing table or remove a key column from an existing table.

Schema and data model | Cloud Spanner Documentation | Google Cloud

Upvotes: 4

Related Questions