I'm migrating from MySQL to PostgreSQL. I need to find all columns that have unique constraints in a table. What is the equivalent of below query in PostgreSQL?
SELECT column_name, index_name
FROM information_schema.statistics
WHERE table_schema='db' and table_name='tb' and non_unique=0 and index_name != 'PRIMARY'