On Tue, Mar 9, 2010 at 7:31 AM, Pavel Stehule <pavel.steh...@gmail.com> wrote:
> 2010/3/9 Tom Lane <t...@sss.pgh.pa.us>:
>> Robert Haas <robertmh...@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.  In 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

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to