postgresql.information_schema.EXT_INDEXES.sql Maven / Gradle / Ivy
The newest version!
SELECT
CURRENT_DATABASE()::INFORMATION_SCHEMA.SQL_IDENTIFIER AS INDEX_CATALOG,
INDEXES.SCHEMANAME AS INDEX_SCHEMA,
INDEXES.INDEXNAME AS INDEX_NAME,
INDEXES.TABLENAME AS TABLE_NAME,
PG_CATALOG.OBJ_DESCRIPTION(PGC.OID, 'pg_class') AS REMARKS,
INDEXES.INDEXDEF AS INDEX_DEFINITION
FROM
PG_INDEXES INDEXES
INNER JOIN PG_CATALOG.PG_CLASS PGC
ON INDEXES.INDEXNAME = PGC.RELNAME
ORDER BY
INDEXES.SCHEMANAME,
INDEXES.TABLENAME,
INDEXES.INDEXNAME