Re: Trigger function which inserts into table; values from lookup - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Trigger function which inserts into table; values from lookup
Date
Msg-id 20070520235743.GA25843@alvh.no-ip.org
Whole thread Raw
In response to Re: Trigger function which inserts into table; values from lookup  (novnov <novnovice@gmail.com>)
Responses Re: Trigger function which inserts into table; values from lookup
List pgsql-general
novnov escribió:
>
> Inching closer; the following handles the dupe key error but doesn't insert
> the rows it should either. So, the exception is ending the insert, and not
> continuing to insert for rows that don't violate the unique key restraint.
> Is there a way around this or will I need to take a different approach?

You have to make the function return NEW, not NULL, if this is a BEFORE
trigger.


--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: FULL JOIN is only supported with merge-joinable join conditions
Next
From: novnov
Date:
Subject: Re: Trigger function which inserts into table; values from lookup