Re: [SQL] Trigger Procedure Error: NEW used in query that is not in a rule

2007-08-11 Thread Javier Fonseca V.
Yes Tom, you're right, but the real problem is that I need to use an EXECUTE statement because my table name is dynamic. In your example, you used logt as a static table name, and that doesn't need an EXECUTE statement. So I think that I'll have to rewrite a Trigger Procedure for each table and t

[SQL] Trigger Procedure Error: NEW used in query that is not in a rule

2007-08-11 Thread Javier Fonseca V.
Hello. I'm doing a Trigger Procedure in pl/pgSQL. It makes some kind of auditing. I think that it's working alright except for the next line: EXECUTE 'INSERT INTO ' || quote_ident(somedynamictablename) || ' SELECT new.*'; PostgreSQL keeps telling me: "ERROR: NEW used in query that is not in a