Re: Problem creating trigger-function with arguments (8.0rc4) - Mailing list pgsql-general

From Florian G. Pflug
Subject Re: Problem creating trigger-function with arguments (8.0rc4)
Date
Msg-id 41E28A00.70708@phlo.org
Whole thread Raw
In response to Re: Problem creating trigger-function with arguments (8.0rc4)  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Michael Fuhr wrote:
> On Fri, Jan 07, 2005 at 09:00:12PM +0100, Florian G. Pflug wrote:
>>CREATE OR REPLACE FUNCTION functions.t_insert_deny(v_message text)
>>RETURNS "trigger" AS $$
> See the "Trigger Procedures" section of the PL/pgSQL documentation.
> The first paragraph contains this:
>
>     Note that the function must be declared with no arguments even if
>     it expects to receive arguments specified in CREATE TRIGGER ---
>     trigger arguments are passed via TG_ARGV, as described below.
Seems I should have RTFMed more ;-). I believe I even read this
paragraph, but thought this refers to C-Functions, not plpgsql ones.
Thanks for pointing this out.

>>If I replace RETURNS "trigger" with e.g. RETURNS "int8" it works...
>>Is this is a bug, or has something regarding triggerfunctions and
>>parameters changed in 8.0
> Changed since when?  Are you saying this worked in an older version
> of PostgreSQL?  If so, what version?  The paragraph I quoted above
> goes back to at least 7.2.
I didn't test on anything other than 8.0 - but I used the 7.4 docu, not
the 8.0 one, and since the docu says that trigger functions _can_ take
parameters, I somehow believed that it has to be possible to _declare_
those arguments - Well, guess I should read more carefully ;-)

greetings, Florian Pflug


Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: could not open relation No such file or directory after alter table
Next
From: Alban Hertroys
Date:
Subject: Re: Transaction size