I was testing a function that had multiple UPDATE
statements within IF-ELSE
blocks.
I was testing all possible paths, so I reset the tables to their previous values with 'manual' UPDATE
statements each time before running the function again.
I noticed that the issue would happen just after those UPDATE
statements;
I added a COMMIT;
after the UPDATE
statement I used to reset the tables and that solved the problem.
So, caution, the problem was not the function itself...