I am able to to list all indexes on tables by using pg_indexes. This however, does not list the indexes created on the materialized view. Neither does the pgadmin3 frontend show the indexes on materialized views.
Is there a way?
I am able to to list all indexes on tables by using pg_indexes. This however, does not list the indexes created on the materialized view. Neither does the pgadmin3 frontend show the indexes on materialized views.
Is there a way?
If I understand your question correctly (even though there's a lot of ambiguity), you can use the
pg_indexesview to get information about indexes on materialized views. I used an example schema and query to verify that you can use to list all indexes on materialized views in thepublicschema:This query joins the
pg_indexesview with thepg_classtable to filter out only materialized views (relkind = 'm'). You can modify theWHEREclause to filter the results based on your needs.This was tested on PostgreSQL 14 (on Google Colab to be exact)
You can also refer to these for more insight