How to list all constraints of a table in PostgreSQL? How to list all constraints (Primary key, check, unique mutual exclusive, ..) of a table in PostgreSQL?
Constraints can be retrieved via pg_catalog.pg_constraint.

SELECT con.*
       FROM pg_catalog.pg_constraint con
            INNER JOIN pg_catalog.pg_class rel
                       ON rel.oid = con.conrelid
            INNER JOIN pg_catalog.pg_namespace nsp
                       ON nsp.oid = connamespace
       WHERE nsp.nspname = '&lt;schema name&gt;'
             AND rel.relname = '&lt;table name&gt;';


Replace &lt;schema name&gt; with the name of your schema and &lt;table name&gt; with the name of your table.