Re: Problem with sequence et rule
От | Marc Boucher |
---|---|
Тема | Re: Problem with sequence et rule |
Дата | |
Msg-id | 3.0.5.32.20040802003105.00802b50@pop.gmx.net обсуждение исходный текст |
Ответ на | Re: Problem with sequence et rule (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-bugs |
At 21:28 31/07/2004 -0400, Tom Lane wrote: >>> Now my questions are: >>> - Is this an expected behavior ? > It is. Rules are essentially macros and so you have all the usual > potential gotchas with multiple evaluations of their input arguments. I've understood what was done by the evaluation process. I was just expecting that the "NEW" variable would contain the inserted values (after all it contains correct values for non-sequence columns). > The recommended way to handle this type of problem is with a trigger > rather than a rule. I've changed this operation into a trigger, and it works like a charm. The function receives the correct values, even the oid (which "rule" doesn't provide). I've since modified my queries to use the unified table, and I've gained approx. 25-35% of execution time. Interesting on an admin page that takes seconds to generate (hundreds of table lookups). Thanks for your help. -- Marc
В списке pgsql-bugs по дате отправления: