Re: Row insertion w/ trigger to another table update causes row insertion to _not_ occur

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Ow Mun Heng <ow(dot)mun(dot)heng(at)wdc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Row insertion w/ trigger to another table update causes row insertion to _not_ occur
Date: 2009-07-21 23:12:27
Message-ID: 407d949e0907211612g78612566y7095cb8bcef2ed48@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 21, 2009 at 11:25 PM, Ow Mun Heng<ow(dot)mun(dot)heng(at)wdc(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ow Mun Heng 2009-07-22 01:34:47 Re: Row insertion w/ trigger to another table update causes row insertion to _not_ occur
Previous Message Sam Mason 2009-07-21 22:57:53 Re: element from an array by its index