How to get the list of postgres check constraints of a table?
How to list all constraints (Primary key, check, unique mutual exclusive, ..) of a table in PostgreSQL?
Postgres check 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 = ''
AND rel.relname = '';
Replace with the name of your schema and