Re: Unexpected behavior

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Unexpected behavior
Дата
Msg-id 20060502175318.GC13702@svana.org
обсуждение исходный текст
Ответ на Re: Unexpected behavior  ("Steve V" <dndlists@gmail.com>)
Список pgsql-general
On Tue, May 02, 2006 at 12:11:34PM -0500, Steve V wrote:
> >When that rule should never fire (the id hasn't changed). If I change
> >the conditional of the rule to something that must always be false
> >(like false, or 1 = 0), it will still behave in this manner.
>
> Does anyone know what's going on here? I'm experiencing an identical
> situation, and it doesn't seem logical. If it evaluates to false, why
> on earth is the function result set attempting to be returned? Maybe
> not a bug, but definitely unexpected behavior

A rule is a macro. This means that the expression in the rule will
always happen. If you have a rule to do a SELECT after an UPDATE, the
client will see the results of the SELECT.

You almost never want RULEs. It's not clear what you want to do, but a
trigger is more likely to do what you want (as well as a lot easier to
understand).

If you set debug_print_rewritten=on you should be able to see what is
actually being executed...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: PG_RETURN_?
Следующее
От: "Florian G. Pflug"
Дата:
Сообщение: Re: Using a pointer as statetype for an aggregate