在传统的PostgreSQL数据库中,我试图删除发出命令的现有索引:
DROP INDEX testing.idx_testing_data_model_output_data_id;
并看到错误:
ERROR: index "<index name>" does not exist
但是我可以使用\d <table name>
命令看到索引:
leg=# \d testing.data_model
Table "testing.data_model"
Column | Type | Modifiers
----------------+-----------------------------+---------------------------------------------------------------------------
id | bigint | not null default nextval('testing.data_model_id_seq'::regclass)
input_data | text |
output_data_id | bigint |
Indexes:
"pk_testing_data_model" PRIMARY KEY, btree (id)
"idx_testing_data_model_output_data_id" btree (output_data_id)
好的,当我尝试创建索引时,收到以下错误:
ERROR: relation "<index name>" already exists
似乎某种程度上索引创建或索引删除未成功完成。我该如何解决这个问题?