Re: triggers and TriggerData

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: triggers and TriggerData
Дата
Msg-id 20070122150437.GA65433@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: triggers and TriggerData  (Alan Hodgson <ahodgson@simkin.ca>)
Ответы Re: triggers and TriggerData  (Alan Hodgson <ahodgson@simkin.ca>)
Список pgsql-general
On Sun, Jan 21, 2007 at 09:05:30PM -0800, Alan Hodgson wrote:
> On Sunday 21 January 2007 15:56, gustavo halperin <ggh.develop@gmail.com> wrote:
> > 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.

You can pass literal string arguments to a trigger function.  See
the CREATE TRIGGER documentation and, for PL/pgSQL, TG_ARGV and
TG_NARGS.  For C see "Writing Trigger Functions in C"; search for
tgnargs and tgargs.

http://www.postgresql.org/docs/8.2/interactive/sql-createtrigger.html
http://www.postgresql.org/docs/8.2/interactive/plpgsql-trigger.html
http://www.postgresql.org/docs/8.2/interactive/trigger-interface.html

(These links are to the 8.2 documentation but earlier versions also
support arguments to trigger functions.)

--
Michael Fuhr

В списке pgsql-general по дате отправления:

Предыдущее
От: "Moritz Bayer"
Дата:
Сообщение: Re: Loop in loop
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Loop in loop