Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 29DB3153906F for ; Wed, 13 Jun 2012 08:55:04 -0300 (ADT) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SemAB-0001Tg-0H for pgsql-bugs@postgresql.org; Wed, 13 Jun 2012 11:55:03 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sem9y-0005k0-2A for pgsql-bugs@postgresql.org; Wed, 13 Jun 2012 11:54:50 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1Sem9x-0006K6-CE for pgsql-bugs@postgresql.org; Wed, 13 Jun 2012 11:54:49 +0000 Date: Wed, 13 Jun 2012 11:54:49 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6690: ALL and ANY array operators To: pgsql-bugs@postgresql.org From: sergey-1987@yandex.ru X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/130 X-Sequence-Number: 33357 The following bug has been logged on the website: Bug reference: 6690 Logged by: sergey Email address: sergey-1987@yandex.ru PostgreSQL version: 9.1.2 Operating system: FreeBSD 8.1 Description: = As I see in documentation, http://www.postgresql.org/docs/current/static/functions-aggregate.html there is an ambiguity with bool_or aggregate and ANY array operator, so bool_or cannot has standard name ANY. So ANY should always mean array operator. But such query produces syntax error: select 1 =3D ANY((select ARRAY[1, 2]::integer[])) I.e. when I try to check is some element in array, that is calculated in subquery, I cannot. I can use: select ARRAY[1] && (select ARRAY[1, 2]::integer[]) but what about ANY operator? For example this works: select 1 =3D ANY(ARRAY[1, 2]::integer[]); select 1 in (select * from unnest(ARRAY[1, 2]::integer[]))