Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Feedback on whether index was created on materialized views in postgresql

I created a unique index for a materialized view as :

create unique index if not exists matview_key on
      matview (some_group_id, some_description);

I can’t tell if it has been created
How do I see the index?

Thank you!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Two ways to verify index creation:

--In psql
\d matview

--Using SQL

select 
  * 
from 
   pg_indexes 
where 
   indexname = 'matview_key' 
and 
   tablename = 'matview';

More information on pg_indexes.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading