Updated on 2026-07-02 GMT+08:00

PG_INDEXES

PG_INDEXES displays access to useful information about each index in the database.

Table 1 PG_INDEXES columns

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;