| От | Tom Lane |
|---|---|
| Тема | Re: Problem with RULE to update tables |
| Дата | |
| Msg-id | 7798.1047930089@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Problem with RULE to update tables (Sean Reifschneider <jafo@tummy.com>) |
| Ответы |
Re: Problem with RULE to update tables
|
| Список | pgsql-bugs |
Sean Reifschneider <jafo@tummy.com> writes:
> I've tried this on both 7.3 and 7.2.3, and am running into an odd
> problem. Basically I have one table that is a count of available and one
> that has allocations against that. I wanted to use rules to auto-update the
> available count, and everything works fine as long as I do deletes
> one-by-one...
> If I delete multiple records, the available count is only updated once.
Yup. A rule is invoked once per query, not once per operated-on record.
You'll find that a trigger acts more like what you are expecting.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера