Re: is this a bug?

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:09:05
Message-ID: D7131CA7-9EB5-496B-80E3-DF203215D2DA@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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
>
>> I would expect those to evaluate to the same thing.
>
> 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);
?column?
----------
[null]

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-01-18 01:38:10 Re: is this a bug?
Previous Message Kevin Grittner 2010-01-18 00:53:30 Re: Git out of sync vs. CVS