PostgreSQL データベースのindexの一覧を取得する

環境
Windows 10 Home 64bit
PostgreSQL 13.2

SQL構文
SELECT schemaname, tablename, indexname FROM pg_indexes;
データベースのindexの一覧を取得します。

実行結果

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# SELECT schemaname, tablename, indexname FROM pg_indexes;
schemaname | tablename | indexname
------------+-------------------------+-----------------------------------------------
pg_catalog | pg_aggregate | pg_aggregate_fnoid_index
pg_catalog | pg_am | pg_am_name_index
pg_catalog | pg_am | pg_am_oid_index
postgres=# SELECT schemaname, tablename, indexname FROM pg_indexes; schemaname | tablename | indexname ------------+-------------------------+----------------------------------------------- pg_catalog | pg_aggregate | pg_aggregate_fnoid_index pg_catalog | pg_am | pg_am_name_index pg_catalog | pg_am | pg_am_oid_index
postgres=# SELECT schemaname, tablename, indexname FROM pg_indexes;
 schemaname |        tablename        |                   indexname
------------+-------------------------+-----------------------------------------------
 pg_catalog | pg_aggregate            | pg_aggregate_fnoid_index
 pg_catalog | pg_am                   | pg_am_name_index
 pg_catalog | pg_am                   | pg_am_oid_index

 

PostgreSQL

Posted by arkgame