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 86d227fd0708110045t16e39442xd35746eb59296362@mail.gmail.com
обсуждение исходный текст
Ответы Re: Trigger Procedure Error: NEW used in query that is not in a rule  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Re: Trigger Procedure Error: NEW used in query that is not in a rule  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-sql
<span class="gmail_quote"></span><p>Hello.<p>I'm doing a Trigger Procedure in pl/pgSQL.  It makes some kind of
auditing.<p>Ithink that it's working alright except for the next line:<p>EXECUTE 'INSERT INTO ' ||
quote_ident(somedynamictablename)|| ' SELECT new.*';<p>PostgreSQL keeps telling me: "ERROR: NEW used in query that is
notin a rule".  I think that this NEW problem is because of the scope of the EXECUTE statement (outside the scope of
thetrigger), so it doesn't recognize the NEW record. <p>Maybe I could fix it concatenating column names and the 'new'
valuesbut I want to do my trigger as flexible as possible (I have several tables to audit).<p>Somebody has any
suggestion?<p>Thanksa lot,<span class="sg"><p>Javier</span> 

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

Предыдущее
От: "Rodrigo De León"
Дата:
Сообщение: Re: Best Fit SQL query statement
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Trigger Procedure Error: NEW used in query that is not in a rule