Get constraint definition in PostgreSQL
pg_get_constraintdef can be used to get the SQL definition of a constraint.
select pg_get_constraintdef(oid) from pg_constraint where conname='users_tenant_id_fkey';
-- => FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON DELETE CASCADE