Re: minimal update - Mailing list pgsql-hackers

From Decibel!
Subject Re: minimal update
Date
Msg-id 150717AA-3427-4FC4-99CD-547B6505AA69@decibel.org
Whole thread Raw
In response to Re: minimal update  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Oct 22, 2008, at 1:43 PM, Andrew Dunstan wrote:
> +     if (!CALLED_AS_TRIGGER(fcinfo))
> +         elog(ERROR, "min_update_trigger: not called by trigger  
> manager");

The error I get in 8.2 when calling a trigger function directly is:

ERROR:  trigger functions may only be called as triggers

To stay consistent, I think the remaining errors should s/: not/ may  
only be/, ie:

min_update_trigger may only be called on update     
> +     /* and that it's called on update */
> +     if (! TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event))
> +         elog(ERROR, "min_update_trigger: not called on update");
> +
> +     /* and that it's called before update */
> +     if (! TRIGGER_FIRED_BEFORE(trigdata->tg_event))
> +         elog(ERROR, "min_update_trigger: not called before update");
> +
> +     /* and that it's called for each row */
> +     if (! TRIGGER_FIRED_FOR_ROW(trigdata->tg_event))
> +         elog(ERROR, "min_update_trigger: not called for each row");

-- 
Decibel!, aka Jim C. Nasby, Database Architect  decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828



pgsql-hackers by date:

Previous
From: Decibel!
Date:
Subject: Re: Regression in IN( field, field, field ) performance
Next
From: Simon Riggs
Date:
Subject: Re: Reducing the memory footprint of large sets of pending triggers