PostgreSQL – Disable Foreign Keys

PostgreSQL doesn’t have an explicit way to disable foreign keys. It does have a way to do so implicitly however because foreign keys are implemented via hidden triggers. If you need to disable foreign keys for a table load, etc it’s very easy: