Re: Empty Updates, ON UPDATE triggers and Rules

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Empty Updates, ON UPDATE triggers and Rules
Дата
Msg-id b42b73150908061135n3dd53b4bp8b728898329258b2@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Empty Updates, ON UPDATE triggers and Rules  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-general
On Thu, Aug 6, 2009 at 1:38 PM, Jeff Davis<pgsql@j-davis.com> wrote:
> 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.

it should, maybe try old::foo = new::foo

>>   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?

If you think that's weird, check out:

postgres=# select (50, 0)::foo > (50, null)::foo;
 ?column?
----------
 f
(1 row)

postgres=# select (50, 0)::foo < (50, null)::foo;
 ?column?
----------
 t
(1 row)

I think maybe Pavel is right and is distinct from is safer, but I'd
argue against any change that disallowed comparisons of composites
with nulls in them.

merlin

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: JOIN a UNION
Следующее
От: Tom Lane
Дата:
Сообщение: Re: What happens when syslog gets blocked?