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

Поиск
Список
Период
Сортировка
От Javier Fonseca V.
Тема Trigger Procedure Error: NEW used in query that is not in a rule
Дата
Msg-id 86d227fd0708110043q341a2908q67e87570bca89492@mail.gmail.com
обсуждение исходный текст
Ответы Re: Trigger Procedure Error: NEW used in query that is not in a rule  (Decibel! <decibel@decibel.org>)
Re: Trigger Procedure Error: NEW used in query that is not in a rule  (Lew <lew@lewscanon.com>)
Re: Trigger Procedure Error: NEW used in query that is not in a rule  (jablonov <jablonov@hotmail.com>)
Список pgsql-general

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 rule".  I think that this NEW problem is because of the scope of the EXECUTE statement (outside the scope of the trigger), so it doesn't recognize the NEW record.

Maybe I could fix it concatenating column names and the 'new' values but I want to do my trigger as flexible as possible (I have several tables to audit).

Somebody has any suggestion?

Thanks a lot,

Javier

В списке pgsql-general по дате отправления:

Предыдущее
От: Julio Cesar Sánchez González
Дата:
Сообщение: Re: Unable to connect to PostgreSQL server via PHP
Следующее
От: Louis-David Mitterrand
Дата:
Сообщение: Re: timestamp skew during 7.4 -> 8.2 upgrade