Til Deferrable Initially Deferred
postgreToday at work I learn something new, I face some unexpected behaviour when test the CRUD functionality, it’s not bug but it’s clearly how stupid I am.
Let say we have table structure like this:
Parent
Id
Name
Child
Id
parent_id
Name
So I create two test, number 1 test happy path
-- parent already exist with id = 1
INSERT INTO child (parent_id, name)
VALUES (1, 'childs');
Expected no error and pass.
Second I tried to insert not existent parent into child
Read more...