3 ms·
How about when the ID in a FK column has been generated outside the RDBMS but the target of the ID has not been written yet?
by pharmakom 4y ago
How about when the ID in a FK column has been generated outside the RDBMS but the target of the ID has not been written yet?
- ashkulz 4y agoYou can use DEFERRABLE INITIALLY DEFERRED constraints so that the check happens when the transaction is committed.
- GoblinSlayer 4y agoI assume the target is externally generated too, thus can be legitimately absent.
- Cthulhu_ 4y agoI had this when importing test data; I found it acceptable (since it was just in development) to temporarily turn off FK checking.