How to list indexes created for table in postgres

后端 未结 3 917
日久生厌
日久生厌 2021-02-01 11:37

Could you tell me how to check what indexes are created for some table in postgresql ?

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 12:18

    You can use this query:

    select tablename,indexname,tablespace,indexdef from pg_indexes where tablename = 'your_table_name';

    where has tablename is a field in pg_indexes ,you an get an accurate indices by matching user defined table at 'your_table_name' at WHERE clause . This will give you the desired details.

提交回复
热议问题