GCP:我们可以修改扳手中现有 table 的主键吗
GCP: Can we modify primary key of an existing table in spanner
我想将 Spanner 中现有 Table 的主键从 Col1 修改为 Col1 和 Col2 的组合。可以在 Spanner 中实现吗?
此选项在控制台中不可用。也许可以用脚本来完成!
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
GCP 团队回复如下:
- 现在唯一的方法是使用 Import/Export 功能重新创建数据库
- 在 Spanner 积压工作中提出了功能请求(无 ETA):https://issuetracker.google.com/135719292
我想将 Spanner 中现有 Table 的主键从 Col1 修改为 Col1 和 Col2 的组合。可以在 Spanner 中实现吗?
此选项在控制台中不可用。也许可以用脚本来完成!
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
GCP 团队回复如下:
- 现在唯一的方法是使用 Import/Export 功能重新创建数据库
- 在 Spanner 积压工作中提出了功能请求(无 ETA):https://issuetracker.google.com/135719292