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

From: "Ow Mun Heng" <ow(dot)mun(dot)heng(at)wdc(dot)com>
To: "Greg Stark" <gsstark(at)mit(dot)edu>
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-22 01:34:47
Message-ID: D1109E8B2FB53A45BDB60F8145905CE902DB3D81@wdmyexbe03.my.asia.wdc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----Original Message-----
From: gsstark(at)gmail(dot)com [mailto:gsstark(at)gmail(dot)com] On Behalf Of Greg Stark
>> 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.

Dang it.. I just re-read the online docs this morning and I missed it.
Then again, since I'm new to triggers, I may have mis-interpreted that.

Thanks for it. I'll give it a go.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aleksander Kmetec 2009-07-22 01:42:36 Inserts into sl_log tables timing out (related to the dataloss bug)
Previous Message Greg Stark 2009-07-21 23:12:27 Re: Row insertion w/ trigger to another table update causes row insertion to _not_ occur