How it works…

When we create a foreign key, we add a constraint to the catalog table known as pg_constraint. Therefore, the query shows us how to find all the constraints that depend upon the orders table.