Re: triggers and TriggerData - Mailing list pgsql-general

From Alan Hodgson
Subject Re: triggers and TriggerData
Date
Msg-id 200701212105.30516@hal.simkin.ca
Whole thread Raw
In response to triggers and TriggerData  (gustavo halperin <ggh.develop@gmail.com>)
Responses Re: triggers and TriggerData  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
On Sunday 21 January 2007 15:56, gustavo halperin
<ggh.develop@gmail.com> wrote:
> First, thank you for your answers about my problem with the function
> 'CREATE TRIGGER',
> I have another question about triggers, how can I pass arguments ?? I
> read about some struct TriggerData *CurrentTriggerData, but I didn't
> found any explanation or example about how to use it in postgres SQL.
>  My problem is that  for any INSERT row in table 'B' I need to pass
> to the function trigger two values  of this row.  Do you know how to
> do so or where are examples of how to do it ??

You cannot pass values to a trigger.

However, insert triggers (in PLpgSQL at least) receive the row value in
the NEW record variable.  There are examples in the documentation.

http://www.postgresql.org/docs/8.2/interactive/plpgsql-trigger.html#PLPGSQL-TRIGGER-EXAMPLE

--
"A government that robs Peter to pay Paul can always depend upon the
support of Paul." - George Bernard Shaw


pgsql-general by date:

Previous
From: gustavo halperin
Date:
Subject: triggers and TriggerData
Next
From: Chris Browne
Date:
Subject: Re: Who is Slony Master/Slave + general questions.