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