Re: Bug in triggers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Oleg Serov <serovov(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug in triggers
Date: 2010-03-07 17:08:31
Message-ID: 17572.1267981711@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Fri, Mar 5, 2010 at 5:32 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> It's arguably a bug, but since we lack consensus on whether NULL and
>> ROW(NULL,NULL,...) are the same thing, it's difficult to make a
>> bulletproof case either way.

> Have we or can we somehow document why this happens?

The reason it happens is that the assignment target is a "row" variable,
meaning that it doesn't have concrete existence as a tuple but is just
an alias for a list of scalar variables. So there is no way for it to
represent an atomic NULL; setting each of the individual scalars to NULL
is possible but the result acts more like ROW(NULL,NULL,...).

I'm not sure about documenting that. It seems like an implementation
detail. If we had consensus that the two cases either should or should
not be distinguishable, we could work towards making that happen; but
lacking such consensus I'm hesitant to touch it at all.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Chris Travers 2010-03-07 17:51:27 Re: Bug in triggers
Previous Message Bruce Momjian 2010-03-07 02:17:18 Re: BUG #5348: Postgres crashes with index on xpath_string