Re: PL/SQL question - Mailing list pgsql-general

From Mike Nolan
Subject Re: PL/SQL question
Date
Msg-id 200404212034.i3LKYXAe031029@gw.tssi.com
Whole thread Raw
In response to Re: PL/SQL question  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
List pgsql-general
> 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

pgsql-general by date:

Previous
From: "Lee Harr"
Date:
Subject: Re: Ordering YYYY MM DD in reverse chrono order
Next
From: "Eric Dahnke"
Date:
Subject: Multiple DBs, One app, How to do relations?