Re: Empty Updates, ON UPDATE triggers and Rules

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Empty Updates, ON UPDATE triggers and Rules
Дата
Msg-id 162867790908061130m4a2bfbf1u8445cc4fb0556c49@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Empty Updates, ON UPDATE triggers and Rules  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-general
2009/8/6 Jeff Davis <pgsql@j-davis.com>:
> On Thu, 2009-08-06 at 13:15 -0400, Merlin Moncure wrote:
>> in 8.4 you can (and should) do:
>> WHERE old = new
>
> I couldn't get that to work in a rule.
>
>>   IF NEW != OLD THEN  -- 8.4 syntax
>
> Does this work correctly in the case of NULLs? It looks like it does,
> but that seems strange, because ROW(1, NULL) = ROW(1, NULL) evaluates to
> NULL. Where is this documented?
>

it's not safe, I thing so correct test is

IF NEW IS NOT DISTINCT FROM OLD THEN ...

regards
Pavel Stehule

> Regards,
>        Jeff Davis
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

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

Предыдущее
От: "david.schruth"
Дата:
Сообщение: Re: JOIN a UNION
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: JOIN a UNION