So an insert violates a constraint because a trigger modifies the data when it shouldn't for this case.
Thing is, I already disabled the triggers that I thought were causing this, and the function still gets called.
How do I best get the triggers I'm missing?
Note that the function is called WITHIN the trigger function, so
SELECT * FROM information_schema.triggers WHERE action_statement LIKE '%my_function%';
returns nothing;
To find which trigger uses a certain trigger function, query the catalog:
If the function you are talking about is not the trigger function proper, but called from a trigger function, things are more difficult.
Since functions in languages other than
candinternalare stored as strings, PostgreSQL doesn't track dependencies between functions.So the best you can do in that case is a substring search: