Re: rules problem
От | Joshua Moore-Oliva |
---|---|
Тема | Re: rules problem |
Дата | |
Msg-id | 200303210518.16577.josh@chatgris.com обсуждение исходный текст |
Ответ на | rules problem (Georgi Chorbadzhiyski <gf@unixsol.org>) |
Ответы |
Re: rules problem
|
Список | pgsql-general |
Usually it's a good idea to get rid of errors? Hope you got the big foam HOS on :) Josh. On March 21, 2003 05:18 am, Georgi Chorbadzhiyski wrote: > Hi, I have strange problem with rules. It looks like when multiple rows > are affected, the rule is executed only for the first row. > Is this expected behaviour? Please someone hit me with a cluebat :) > > Please try the attached two tests to see what I mean. > The tests are for pgsql-7.2 if you want to try them on 7.3 after > DROP TABLE xxx add CASCADE, and remove DROP RULE xxx lines. > > Here's what I see: > > *** First test *** > DROP > CREATE > DROP > CREATE > ERROR: Rule or view "add_to_data" not found > CREATE > ERROR: Rule or view "del_from_data" not found > CREATE > INSERT 357883308 1 > INSERT 357883309 1 > INSERT 357883310 1 > INSERT 357883311 1 > INSERT 357883312 1 > id | data_counters | expected > ----+---------------+------------------------------ > 1 | 4 | data_counters should be == 4 > (1 row) > > DELETE 4 > id | data_counters | expected > ----+---------------+------------------------------------ > 1 | 3 | data_counters should be == 0 NOT 3 > (1 row) > > > *** Second test *** > DROP > CREATE > DROP > CREATE > ERROR: Rule or view "add_to_data" not found > CREATE > ERROR: Rule or view "del_from_data" not found > CREATE > INSERT 357886505 1 > INSERT 357886506 1 > INSERT 357886507 1 > INSERT 357886508 1 > INSERT 357886509 1 > id | data_counters | expected > ----+---------------+------------------------------ > 1 | 4 | data_counters should be == 4 > (1 row) > > DELETE 1 > DELETE 1 > DELETE 1 > DELETE 1 > id | data_counters | expected > ----+---------------+------------------------------ > 1 | 0 | data_counters should be == 0 > (1 row)
В списке pgsql-general по дате отправления: