From: Michael Fuhr <mike@fuhr.org>
To: Terry Lee Tucker <terry@esc1.com>
Cc: Postgre General <pgsql-general@postgresql.org>
Subject: Re: Error Message
Date: Wed, 26 Oct 2005 19:15:53 -0600
Message-ID: <20051027011553.GA60091@winnie.fuhr.org> (raw)
In-Reply-To: <20051027010006.GA59813@winnie.fuhr.org>
References: <03a301c5da6e$a20b6280$ac1d4318@OWNER>
<11706.1130361821@sss.pgh.pa.us>
<041401c5da84$7429ec90$ac1d4318@OWNER>
<200510261945.19824.terry@esc1.com>
<20051027010006.GA59813@winnie.fuhr.org>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: mike@fuhr.org, terry@esc1.com
Subject: Re: Error Message
In-Reply-To: <20051027011553.GA60091@winnie.fuhr.org>
References: <03a301c5da6e$a20b6280$ac1d4318@OWNER> <11706.1130361821@sss.pgh.pa.us> <041401c5da84$7429ec90$ac1d4318@OWNER> <200510261945.19824.terry@esc1.com> <20051027010006.GA59813@winnie.fuhr.org> <20051027011553.GA60091@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox