Re: PL/SQL question

From: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>
To: jeff_eckermann(at)yahoo(dot)com (Jeff Eckermann)
Cc: froggy(at)froggycorp(dot)com (Froggy / Froggy Corp(dot)), pgsql-general(at)postgresql(dot)org
Subject: Re: PL/SQL question
Date: 2004-04-21 20:34:32
Message-ID: 200404212034.i3LKYXAe031029@gw.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Froggy / Froggy Corp. 2004-04-21 20:56:33 Re: PL/SQL question
Previous Message Eric Dahnke 2004-04-21 20:33:58 Multiple DBs, One app, How to do relations?