When should I create a constraint as DEFERRED?

3

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?

    
asked by anonymous 18.03.2015 / 13:24

1 answer

0

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 .

    
28.04.2015 / 20:44