Re: IN and ANY - Mailing list pgsql-hackers

From Joe Conway
Subject Re: IN and ANY
Date
Msg-id 4044FFAB.5000001@joeconway.com
Whole thread Raw
In response to Re: IN and ANY  (Dennis Bjorklund <db@zigo.dhs.org>)
Responses Re: IN and ANY  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: IN and ANY  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Dennis Bjorklund wrote:
> The only reason I brought it up was that to me ANY and IN are pretty much
> the same kind of operator. Up until now I thought that IN really was the
> same as =ANY, but it isn't. I don't like that but of course I have to
> accept it. I would rather have had some elem function/operator for arrays
> like:

I wrestled with the same issue last year.

Offhand I don't know how hard it would be to do, but I wonder if when we 
see:
  argL IN (argR)

we might be able to determine if argL and argR are of the same type or 
if argR is an array of argL, and act accordingly.

But then we need to decide, what happens when we see:  argL IN (argR1, argR2, ...)
and argRn data type is an array of argL data type? Do we check all the 
argRn elements individually and return true if any of them equal argL? 
I'd guess so.

> But as usual I'm 6 months late with my objections :-)

An uncanny ability ;-)

Joe


pgsql-hackers by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: IN and ANY
Next
From: Tom Lane
Date:
Subject: Re: IN and ANY