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