Postgresql dynamic function with current table name
问题 I have a function ( audit.create_audit_table() ) that accepts an array of table names. It creates a single function audit.if_modified_func() and then loops through each table name and creates an audit table and applies a trigger to the main table. The function compiles and is created with no errors. When I run the function select audit.create_audit_table(ARRAY['organization']) I keep getting the following error and I am not sure why because I thought that TG_TABLE_NAME is a automatic variable