Re: Trigger function which inserts into table; values from lookup

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: novnov <novnovice(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trigger function which inserts into table; values from lookup
Date: 2007-05-20 23:57:43
Message-ID: 20070520235743.GA25843@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message novnov 2007-05-21 00:36:05 Re: Trigger function which inserts into table; values from lookup
Previous Message Tom Lane 2007-05-20 21:42:38 Re: FULL JOIN is only supported with merge-joinable join conditions