Re: Row insertion w/ trigger to another table update causes row insertion to _not_ occur - Mailing list pgsql-general

From Greg Stark
Subject Re: Row insertion w/ trigger to another table update causes row insertion to _not_ occur
Date
Msg-id 407d949e0907211612g78612566y7095cb8bcef2ed48@mail.gmail.com
Whole thread Raw
In response to Row insertion w/ trigger to another table update causes row insertion to _not_ occur  ("Ow Mun Heng" <ow.mun.heng@wdc.com>)
Responses Re: Row insertion w/ trigger to another table update causes row insertion to _not_ occur
List pgsql-general
On Tue, Jul 21, 2009 at 11:25 PM, Ow Mun Heng<ow.mun.heng@wdc.com> wrote:
>    RETURN NULL;


From the docs:
"It can return NULL to skip the operation for the current row."
-- http://www.postgresql.org/docs/current/static/trigger-definition.html

Just make your trigger return NEW and it won't kill the insert to the
child table.

--
greg
http://mit.edu/~gsstark/resume.pdf

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: element from an array by its index
Next
From: "Ow Mun Heng"
Date:
Subject: Re: Row insertion w/ trigger to another table update causes row insertion to _not_ occur