Re: triggers and TriggerData

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: triggers and TriggerData
Date: 2007-01-22 05:05:30
Message-ID: 200701212105.30516@hal.simkin.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday 21 January 2007 15:56, gustavo halperin
<ggh(dot)develop(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2007-01-22 05:07:32 Re: Who is Slony Master/Slave + general questions.
Previous Message Chris 2007-01-22 03:47:28 Re: help me to solve the problem