Re: BUG #11804: The delete rule problem

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #11803: avoid "distinct" logic if "limit 1" specified
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERAL] Need guidance on regression.diffs