PostgreSQL:为什么不删除索引? [英] PostgreSQL: Why not remove index?
本文介绍了PostgreSQL:为什么不删除索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望删除表中的索引,但不会删除索引.
I hope to remove index in table, but it occurs not remove index.
CREATE INDEX idx_name ON schema_name.table_name(column1, column2);
然后,删除索引
DROP INDEX idx_name;
但是,它失败了.
错误消息是
ERROR: index "idx_name" does not exist
我该怎么做?
推荐答案
如果您不在搜索路径中,则需要指定架构.
You need to specify schema if it isn't in your search path.
DROP INDEX schema_name.idx_name;
要澄清:
要创建的索引的名称.此处不能包含任何架构名称;总是在以下位置创建索引与其父表相同的架构
这篇关于PostgreSQL:为什么不删除索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文