Alter Rename to with table后,不能创建旧名称的表



使用Alter Rename to(已重命名的表)无法创建旧名称的表

Alter table testdb rename to testdb2

现在不能用testdb创建表

Cockroach Db Version: 19.1.2

蟑螂目前不支持自动交换表名。参见此问题:https://github.com/cockroachdb/cockroach/issues/54562

我刚刚在v19.1.2和几个以后的版本上测试了这个,它看起来工作得很好:

> create table testdb (a int);
CREATE TABLE
> alter table testdb rename to testdb2;
RENAME TABLE
> create table testdb (a int);
CREATE TABLE

你能共享你正在运行的命令吗?在单个多语句事务的上下文中有一个已知的限制,但我不清楚您是否正在这样做:https://www.cockroachlabs.com/docs/stable/known-limitations.html#schema-changes-within-transactions

而且,v19.1.2已经很老了,不再受支持。您应该至少升级到19.2:https://www.cockroachlabs.com/docs/releases/release-support-policy.html#current-supported-releases

最新更新