Why do I get a circular query when I insert tuples with this rule ?
От | xavier.goddeeris@dds.delphiauto.com (Xavier Goddeeris) |
---|---|
Тема | Why do I get a circular query when I insert tuples with this rule ? |
Дата | |
Msg-id | 6bf22014.0110150530.389addfd@posting.google.com обсуждение исходный текст |
Ответы |
Re: Why do I get a circular query when I insert tuples with this rule ?
|
Список | pgsql-general |
Hi. Here is my problem: I am using PostgreSQL 7.1.3. I want to create a RULE to modify the values in an insert query. Here is my rule: CREATE RULE old_error_codes AS ON insert to Passage WHERE erreur<>0 and ligne<>1 and erreur<500 DO INSTEAD insert into Passage(idinjecteur, ligne, datedesortie, estbon, nomcible, erreur, derniertest, nodupassage) values (new.idinjecteur, new.ligne, new.datedesortie, new.estbon, new.nomcible, new.erreur+500, new.derniertest, new.nodupassage); What I don't understand, is that, with this rule when I insert a tuple I get the error message "ERROR: Query rewritten 10 times, may contain cycles". Once he has done for the first time, the action specified in the rule, Postgres doesn't have to re-execute the action in the rule, because the second time he checks the rule he finds that "erreur" is not < 500 (the condition of the rule is false). Don't understand. Please help me. Thank you, xav.
В списке pgsql-general по дате отправления: