Re: Bug in triggers

Поиск
Список
Период
Сортировка
От Chris Travers
Тема Re: Bug in triggers
Дата
Msg-id 5ed37b141003090746s2d46abe5o1a952d3f9311e240@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Bug in triggers  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Bug in triggers
Список pgsql-bugs
On Tue, Mar 9, 2010 at 7:31 AM, Pavel Stehule <pavel.stehule@gmail.com> wro=
te:
> 2010/3/9 Tom Lane <tgl@sss.pgh.pa.us>:
>> Robert Haas <robertmhaas@gmail.com> writes:
>>> What seems odd to me is that NEW is apparently some other kind of
>>> thing that is not the same kind of thing as the row variable.
>>
>> NEW is a record variable, not a row variable. =A0In this context that's
>> sensible because its actual rowtype is unspecified by the function text.
>> The implications for row-null handling aren't obvious though :-(
>>
>
> is it necessary definition there? This is defined well from context.
>
I am assuming that Tom's previous objections may have to do with
C-language triggers as well but I couldn't tell from reading the docs.
 This may because I am no C-guru.

I think this behavior is unexpected, but not a bug.  The best fix is
documenting the datatype better.  Something like adding a paragraph to
chapter 38.9 just above the examples (going off the 8.4 docs):

Please note, NEW and OLD records are not guaranteed to follow the full
internal representation of the tuple in question.  In some cases (such
as casting to text) this can create subtle differences which make
comparisons problematic.  In some cases you may need to properly cast
NEW and OLD prior to making comparisons.

Best Wishes,
Chris Travers

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: duplicate key violates unique contraint on pg_type_typname_nsp_index
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bug in triggers