Re: Need "InBetween" (not just Before and After) Trigger
В списке pgsql-general по дате отправления:
| От | Bruno Wolff III |
|---|---|
| Тема | Re: Need "InBetween" (not just Before and After) Trigger |
| Дата | |
| Msg-id | 20010113161647.B28414@wolff.to обсуждение |
| Ответ на | Need "InBetween" (not just Before and After) Trigger (Matt Doucleff <matt@digitalfountain.com>) |
| Список | pgsql-general |
On Sat, Jan 13, 2001 at 01:23:27PM -0800, Matt Doucleff <matt@digitalfountain.com> wrote: > > If I use a "before" trigger, the constraints are checked after I've already > performed my action. Thus I have performed my action yet no row is inserted > (which is inconsistent). > > If I use an "after" trigger, the constraints are checked first. If the row is > inserted, I attempt to perform my action. If my action fails, then I have an > inserted row but no action, which is also inconsistent. > > The only solution I've developed involves a duplicate table and a transaction. I think what you want to do is defer constraint checking until the end of a transaction. You can make a constraint deferable and make the default for it to be checked at the end of a transaction instead of immediately after a change.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера