Hi I want to write a trigger but i have some problems.

this is the function I use

insert into xti_log values ((select max(pkey) from xti_log) + 1, 'users', uid ,'D', current_timestamp, current_user);
return null;

But instead of 'users' I want the table, at runtime, where the trigger is executed...
Instead of uid, there must come the uid of the new row, I'll tried NEW.uid but it doesn't work...

Can anyone help me?

Thanx a lot