| От | Tom Lane |
|---|---|
| Тема | Re: BUG #11804: The delete rule problem |
| Дата | |
| Msg-id | 31109.1414525597@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | BUG #11804: The delete rule problem (djlu126@126.com) |
| Список | pgsql-bugs |
djlu126@126.com writes:
> [ complicated example ]
It's pretty much a crapshoot what you're going to get out of that
details_d1 rule, because it specifies multiple updates to the same
row of the "stock" table anytime multiple "details" rows with the
same "prd_id" are deleted. That's allowed but only one of the update
actions will take, and it's unspecified which one. (There's been
some talk of making such cases throw an error instead, but that wouldn't
lead to a working solution for you either.)
You'd be *way* better off building this behavior with a trigger,
both as to efficiency and understandability.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера