Reputation: 55
I want a list of default indexes built on primary keys of table used by PostgreSQL for query processing.
Upvotes: 0
Views: 837
Reputation: 891
SELECT RELNAME,
RELKIND
FROM PG_CLASS
WHERE RELKIND = 'i';
Upvotes: 0
Reputation: 19665
From here:
https://www.postgresql.org/docs/current/catalog-pg-constraint.html
SELECT
conname, contype, conindid::regclass
FROM
pg_constraint
WHERE
contype = 'p';
Where conindid::regclass
is the index name.
Upvotes: 1