How to List Indexes in PostgreSQL
Last updated July 25, 2026 · By the SaturnSQL team
In psql, \di lists indexes and \d tablename shows the indexes on one table. From SQL, query the pg_indexes view, which includes the full index definition.
psql
\di
\d ordersPlain SQL (works from any client)
SELECT indexname, indexdef
FROM pg_indexes
WHERE schemaname = 'public'
AND tablename = 'orders'
ORDER BY indexname;Run this in SaturnSQL
SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.
Try it free