Re: plPerl: How to iterate over $_TD->{new} in a trigger function?

Поиск
Список
Период
Сортировка
От Dirk Heinrichs
Тема Re: plPerl: How to iterate over $_TD->{new} in a trigger function?
Дата
Msg-id 200606282015.39032.dirk.heinrichs@online.de
обсуждение исходный текст
Ответ на plPerl: How to iterate over $_TD->{new} in a trigger function?  (Dirk Heinrichs <dirk.heinrichs@online.de>)
Список pgsql-interfaces
Am Mittwoch, 28. Juni 2006 20:00 schrieb Dirk Heinrichs:

> I want to write a generic trigger function, which can be attached to any
> table, but it seems I'm to stupid :-) to get column/value pairs out of
> $_TD->{new} and $_TD->{old}.

OK, got it myself.

> create or replace function test_trig() returns trigger as $$
>         elog (INFO, "Table is: $_TD->{relname}\n");
>         my %newrow = %_TD->{new};my %newrow = %{$_TD->{new}};
>         elog (INFO, "$x=$y\n") while (($x,$y) = each %newrow);
>         return;
> $$ language plperl;

Works as expected.

Bye...
Dirk

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

Предыдущее
От: Dirk Heinrichs
Дата:
Сообщение: plPerl: How to iterate over $_TD->{new} in a trigger function?
Следующее
От: "Francisco Figueiredo Jr."
Дата:
Сообщение: Re: Npgsql MS 2.0 - char bug?