As far as I know, creating a constraint (such as a foreign key or a check) as DEFERRED causes it to only be validated at the end of the transaction.
Why is this used? And when should it not be used?
As far as I know, creating a constraint (such as a foreign key or a check) as DEFERRED causes it to only be validated at the end of the transaction.
Why is this used? And when should it not be used?
A good practice with DEFERRED finds application in moving large volumes of data. When constraint validation occurs only in COMMIT, generally chunk (very large volumes should be split into chunks ) is written faster.
Another possible use would be a key move. In these cases, it is not possible to change primary or foreign keys without postponing or disabling constraints .