Re: IN and ANY

From: Joe Conway <mail(at)joeconway(dot)com>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: IN and ANY
Date: 2004-03-02 21:42:03
Message-ID: 4044FFAB.5000001@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-03-02 21:54:07 Re: IN and ANY
Previous Message Dennis Bjorklund 2004-03-02 20:44:38 Re: IN and ANY