Re: Rules aren't doing what I expect
От | Ang Chin Han |
---|---|
Тема | Re: Rules aren't doing what I expect |
Дата | |
Msg-id | 20000810101820.A8537@pintoo.com обсуждение исходный текст |
Ответ на | Rules aren't doing what I expect (Mark Volpe <volpe.mark@epamail.epa.gov>) |
Список | pgsql-sql |
On Wed, Aug 09, 2000 at 12:04:13PM -0400, Mark Volpe wrote: > I have a table with a trigger that can potentially modify a row before it gets > inserted or updated: [snip] > I have another table that tracks changes in the first table with rules: AFAIK, rules get rewritten first, before triggers are invoked, so your rules are getting the values before your trigger changes them. > The t1_log table doesn't show what was actually inserted into t1! > Are there any changes I can make to the logic above so that t1_log can > show the correct value? Either somehow rewrite your trigger as a rule, or stick another trigger to change the value before getting into your log table. You might be able to reuse your trigger function, I think, just point the trigger to that function. A bit inefficient, since it gets called twice.
В списке pgsql-sql по дате отправления: