PG_INDEXES
PG_INDEXES displays access to useful information about each index in the database.
| Column | Type | Reference | Description |
|---|---|---|---|
| schemaname | Name | PG_NAMESPACE.nspname | Name of the schema that contains tables and indexes |
| tablename | Name | PG_CLASS.relname | Name of the table for which the index serves |
| indexname | Name | PG_CLASS.relname | Index name |
| tablespace | Name | PG_TABLESPACE.spcname | Name of the tablespace that contains the index |
| indexdef | Text | N/A | Index definition (a reconstructed CREATE INDEX command) |
Example
Query the index information about a specified table.
1 | SELECT * FROM pg_indexes WHERE tablename = 'user_info'; |

Query information about indexes of all tables in a specified schema in the current database.
1 | SELECT tablename, indexname, indexdef FROM pg_indexes WHERE schemaname = 'public' ORDER BY tablename,indexname; |

Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot