I'm trying to figure out how to implement a more complex constraint within my postgres database than is provided for by simple foreign key constraints and the like. I believe I have to implement a ...