What is the order of triggers and restrictions? For example, if I insert a bad foreign key, will this fk be detected by pgsql before my own trigger (BEFORE or AFTER)?
I know that an exception inside the trigger rolls back any update / insert made inside the same trigger (even for the AFTER trigger), but is it the same for the constraints? Foreign key constraints do roll back all my attachments / updates from my own trigger?
Thank you
source
share