LoginSignup
2
1

More than 3 years have passed since last update.

[PostgreSQL] あるスキーマの名前に . を含むインデックスを削除する

Posted at

やりたいこと

とある事情で名前に . を含むインデックスが存在した。これを削除したい。

myschema というスキーマの girls テーブルに存在する myprefix.index_girls_on_room_no という名前のインデックスを削除する。

mydb=# DROP INDEX myschema.myprefix.index_girls_on_room_no; -- in public schema
ERROR:  cross-database references are not implemented

mydb=# SET search_path TO myschema;
mydb=# DROP INDEX myprefix.index_girls_on_room_no; -- in myschema schema
ERROR:  schema "myprefix" does not exist

:sob:

mydb=# DROP INDEX myschema."myprefix.index_girls_on_room_no";

インデックス名を "" でくくると成功した :tada:

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1