I am trying to write a trigger function in PostgreSQL 8.2 that will dynamically use TG_TABLE_NAME to generate and execute a SQL statement. I can find all kinds of examples
I also asked a similar question a couple of years ago.
Have a look at that question and see if it gives you any useful ideas:
Inserting NEW.* from a generic trigger using EXECUTE in PL/pgsql