> In fact the problem seems to come from the "INSERT INTO". I delete
> everything from the function and only keep the "INSERT INTO" and get the
> same problem.
Given that this is supposed to be a trigger function, what's
your 'create trigger' statement look like?
Part of the problem may be how your 'return null' is being handled,
and that can be related to when the trigger fires.
--
Mike Nolan