Re: minimal update

From: Decibel! <decibel(at)decibel(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>, Michael Glaesemann <grzm(at)seespotcode(dot)net>, David Fetter <david(at)fetter(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: minimal update
Date: 2008-10-25 05:38:10
Message-ID: 150717AA-3427-4FC4-99CD-547B6505AA69@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-10-25 12:36:19 Re: Reducing the memory footprint of large sets of pending triggers
Previous Message Decibel! 2008-10-25 05:32:30 Re: Regression in IN( field, field, field ) performance