On Wed, Oct 29, 2008 at 03:48:09PM -0400, Andrew Dunstan wrote:
>
>>> +     /* make sure it's called as a trigger */
>>> +     if (!CALLED_AS_TRIGGER(fcinfo))
>>> +         elog(ERROR, "suppress_redundant_updates_trigger: must be called 
>>> as trigger");
>>
>> Shouldn't these all be ereport()?
>
> Good point.
>
> I'll fix them.
>
> Maybe we should fix our C sample trigger, from which this was taken.

Yes :)

Does the attached have the right error code?

Cheers,
David.
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: [EMAIL PROTECTED]

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
diff --git a/doc/src/sgml/trigger.sgml b/doc/src/sgml/trigger.sgml
index a3f17c9..69430ea 100644
--- a/doc/src/sgml/trigger.sgml
+++ b/doc/src/sgml/trigger.sgml
@@ -581,7 +581,9 @@ trigf(PG_FUNCTION_ARGS)
 
     /* make sure it's called as a trigger at all */
     if (!CALLED_AS_TRIGGER(fcinfo))
-        elog(ERROR, "trigf: not called by trigger manager");
+        ereport(ERROR,
+                (error(TRIGGERED_DATA_CHANGE_VIOLATION),
+                 errmsg("trigf: not called by trigger manager")));
 
     /* tuple to return to executor */
     if (TRIGGER_FIRED_BY_UPDATE(trigdata-&gt;tg_event))
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to