Re: is this a bug? - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: is this a bug?
Date
Msg-id D7131CA7-9EB5-496B-80E3-DF203215D2DA@kineticode.com
Whole thread Raw
In response to Re: is this a bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: is this a bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Git out of sync vs. CVS
Next
From: Tom Lane
Date:
Subject: Re: is this a bug?