From: | Michael Fuhr <mike(at)fuhr(dot)org> |
---|---|
To: | Terry Lee Tucker <terry(at)esc1(dot)com> |
Cc: | Postgre General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Error Message |
Date: | 2005-10-27 01:15:53 |
Message-ID: | 20051027011553.GA60091@winnie.fuhr.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Oct 26, 2005 at 07:00:06PM -0600, Michael Fuhr wrote:
> You *can* pass arguments to trigger functions but it's done a little
> differently than with non-trigger functions. The function must be
> defined to take no arguments; it reads the arguments from a context
> structure instead of in the normal way. PL/pgSQL trigger functions,
> for example, read their arguments from the TG_ARGV array.
>
> http://www.postgresql.org/docs/8.0/interactive/plpgsql-trigger.html
> http://www.postgresql.org/docs/8.0/interactive/trigger-interface.html
Also
http://www.postgresql.org/docs/8.0/interactive/sql-createtrigger.html
where the documentation says
CREATE TRIGGER name { BEFORE | AFTER } { event [ OR ... ] }
ON table [ FOR [ EACH ] { ROW | STATEMENT } ]
EXECUTE PROCEDURE funcname ( arguments )
...
arguments
An optional comma-separated list of arguments to be provided to the
function when the trigger is executed. The arguments are literal
string constants. Simple names and numeric constants may be written
here, too, but they will all be converted to strings. Please check
the description of the implementation language of the trigger function
about how the trigger arguments are accessible within the function; it
may be different from normal function arguments.
--
Michael Fuhr
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Fuhr | 2005-10-27 01:37:44 | Re: Variable return type... |
Previous Message | Robert Treat | 2005-10-27 01:02:27 | Re: [GENERAL] Map of Postgresql Users (OT) |