Re: BUG #2889: Syntax error: WHERE ANY(arrayfield) = N

From: "David Higgs" <higgsd(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2889: Syntax error: WHERE ANY(arrayfield) = N
Date: 2007-01-13 19:39:41
Message-ID: ac8e3f230701131139p3997a2f7j53eba52b355382@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 1/13/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "David" <higgsd(at)gmail(dot)com> writes:
> > This statement works:
> > => SELECT * FROM sal_emp WHERE 10000 = ANY (pay_by_quarter);
>
> > But this does not:
> > => SELECT * FROM sal_emp WHERE ANY (pay_by_quarter) = 10000;
> > ERROR: syntax error at or near "ANY" at character ...
>
> This is not a bug, it's the way the syntax works per SQL spec.
> ANY must immediately follow the operator it relates to. See
> <quantified comparison predicate> syntax in the spec.
>
> regards, tom lane
>

Aha, I see it in the docs now, although it's still rather unintuitive.
Could the appropriate section on arrays be crosslinked to the ANY/ALL
page, to preempt this question in the future?

Thanks.

--david

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message michael 2007-01-14 11:31:05 BUG #2892: NULL problems, E_FAIL
Previous Message Tom Lane 2007-01-13 18:46:15 Re: BUG #2889: Syntax error: WHERE ANY(arrayfield) = N