Postgres: To check indexes on a table

 select * from pg_indexes where tablename = 'offers';



select 

    c.relnamespace::regnamespace as schema_name,

    c.relname as table_name,

    i.indexrelid::regclass as index_name,

    i.indisprimary as is_pk,

    i.indisunique as is_unique

from pg_index i

join pg_class c on c.oid = i.indrelid

where c.relname = 'offers';

 




Comments

Popular posts from this blog

Postgres: Clean up stopped replication slot