加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

创建索引后重命名SQLite表/列/行

发布时间:2020-12-12 18:57:05 所属栏目:百科 来源:网络整理
导读:如果我在创建索引后重命名SQLite Tables / Columns / Rows,旧索引是否仍然可用? 谢谢! 解决方法 如果您正在使用ALTER TABLE和RENAME TO重命名表,那么如 this page(来自sqlite文档)所述,索引仍然有效: The ALTER TABLE command in SQLite allows the user
如果我在创建索引后重命名SQLite Tables / Columns / Rows,旧索引是否仍然可用?

谢谢!

解决方法

如果您正在使用ALTER TABLE和RENAME TO重命名表,那么如 this page(来自sqlite文档)所述,索引仍然有效:

The ALTER TABLE command in SQLite allows the user to rename a table […] If the table being renamed has triggers or indices,then these remain attached to the table after it has been renamed.

但请注意,不允许重命名列.这是SQL features not implemented by sqlite之一:

Only the RENAME TABLE and ADD COLUMN variants of the ALTER TABLE command are supported. Other kinds of ALTER TABLE operations such as DROP COLUMN,ALTER COLUMN,ADD CONSTRAINT,and so forth are omitted.

行没有名称(除了具有PK的意义)因此没有真正的重命名方式.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读