Re: Bug in triggers - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Bug in triggers
Date
Msg-id 11439.1268150551@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug in triggers  (Chris Travers <chris@metatrontech.com>)
Responses Re: Bug in triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Bug in triggers  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-bugs
Chris Travers <chris@metatrontech.com> writes:
> 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.

We may need to document it, but not like that; it's (a) incorrect and
(b) unhelpful to the reader, who is left without any clear idea of what
to avoid.  I think that the real issue here doesn't have anything to do
with NEW/OLD as such, but is related to the representational difference
between record and row variables.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Chris Travers
Date:
Subject: Re: Bug in triggers
Next
From: Andrea Suisani
Date:
Subject: Re: duplicate key violates unique contraint on pg_type_typname_nsp_index