在遗留的PostgreSQL DB中,我试图删除发出命令的现有索引:
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似乎在某种程度上,索引创建或索引删除没有成功完成。我怎样才能解决这个问题?
发布于 2022-03-17 12:06:25
SET search_path = <schema_name>;设置search_path对我有效。
https://stackoverflow.com/questions/48558005
复制相似问题