我们如何获得 PostgreSQL 使用的主键的默认索引列表?

How can we get list of default indexes on primary keys used by PostgreSQL?

我想要一个默认索引列表,这些索引建立在 PostgreSQL 用于查询处理的 table 的主键上。

从这里开始:

https://www.postgresql.org/docs/current/catalog-pg-constraint.html

SELECT 
    conname, contype, conindid::regclass 
FROM 
    pg_constraint 
WHERE 
    contype = 'p';

其中 conindid::regclass 是索引名称。