Re: is this a bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: is this a bug?
Date: 2010-01-18 01:38:10
Message-ID: 16954.1263778690@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David E. Wheeler" <david(at)kineticode(dot)com> writes:
> On Jan 17, 2010, at 3:47 PM, Tom Lane wrote:
>>> create type y as (c char, n int);
>>> select ('a', NULL)::y = ('a', NULL)::y; -- TRUE
>>> select ('a', NULL) = ('a', NULL); -- NULL

>> The latter gets simplified to ('a' = 'a') AND (NULL = NULL).
>> The former doesn't --- it goes through record_eq, which treats
>> two nulls as equal.

> Shouldn't this go through record_eq, then?
> try=# select row('a', NULL) = row('a', NULL);

No, the ROW keyword is just noise. It's the cast that is preventing the
expansion. We could possibly change things so that it got expanded out
even with the cast, but on the whole I'm not sure that would be an
improvement. It doesn't make things consistent, it just shifts the
boundary of inconsistency ...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-01-18 02:10:36 Re: AtAbort_Portsl problem
Previous Message David E. Wheeler 2010-01-18 01:09:05 Re: is this a bug?