Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-10 Thread Florian G. Pflug
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 f

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Michael Fuhr
On Fri, Jan 07, 2005 at 03:57:44PM -0700, Michael Fuhr wrote: > By accessing TG_ARGV (not TGARGS) in the function. Tom was probably thinking in C when he said TGARGS. The Trigger type (struct Trigger) has a tgargs member. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Michael Fuhr
On Fri, Jan 07, 2005 at 02:00:07PM -0800, David Fetter wrote: > On Fri, Jan 07, 2005 at 03:52:15PM -0500, Tom Lane wrote: > > > > The CREATE TRIGGER parameter comes to the trigger function via > > TGARGS, not as a regular parameter. > > Um, so how would one write a trigger that takes arguments?

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread David Fetter
On Fri, Jan 07, 2005 at 03:52:15PM -0500, Tom Lane wrote: > "Florian G. Pflug" <[EMAIL PROTECTED]> writes: > > This is what I tried: > > > CREATE OR REPLACE FUNCTION functions.t_insert_deny(v_message text) > > RETURNS "trigger" AS $$ > > There should probably be a specific error check telling you

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Tom Lane
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > This is what I tried: > CREATE OR REPLACE FUNCTION functions.t_insert_deny(v_message text) > RETURNS "trigger" AS $$ There should probably be a specific error check telling you that a trigger function can't take any explicit arguments. But there i

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Michael Fuhr
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