> AFAIK, returning null from a trigger function causes
> the whole operation (insert, update or delete) to be
> aborted, so the transaction is rolled back, including
> the insert inside the function. You want to return
> NEW instead.
That's true on a 'before insert' trigger. An 'after insert' trigger
can return NULL because the insert that triggered it has already
taken place and the value returned by the trigger function is ignored.
That's why it was important to ask the original poster what kind of
trigger it was 'before insert' or 'after insert'.
--
Mike Nolan