> I have a problem: I need put the "table name" as> a parameter in a function!
I think you have to use dynamic statements:
http://www.postgresql.org/docs/8.4/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN