Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 2B4252E0032 for ; Wed, 27 Feb 2008 20:44:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 35312-04 for ; Wed, 27 Feb 2008 20:44:02 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by postgresql.org (Postfix) with ESMTP id B570F2E0041 for ; Wed, 27 Feb 2008 20:44:08 -0400 (AST) X-EthosMedia-Virus-Scanned: no infections found Received: from [64.81.245.111] (account josh@agliodbs.com HELO temoku.sf.agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 15579074; Wed, 27 Feb 2008 16:46:52 -0800 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: "Dawid Kuroczko" Subject: Re: Subselects returning array and ANY... Date: Wed, 27 Feb 2008 16:45:21 -0800 User-Agent: KMail/1.8 Cc: pgsql-sql@postgresql.org References: <758d5e7f0802271601m592a932bh5916b10eccecbb4a@mail.gmail.com> <200802271611.50928.josh@agliodbs.com> <758d5e7f0802271634q7d8bbdc0t29cb94e932526f22@mail.gmail.com> In-Reply-To: <758d5e7f0802271634q7d8bbdc0t29cb94e932526f22@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802271645.22055.josh@agliodbs.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/230 X-Sequence-Number: 30321 Dawid, > But you are right, though! I just need to leave off the subselect! > Thanks! SELECT h.* FROM haystack h JOIN needles ON straw = ANY (straws); > > (not exactly what I was looking for, but it works ;)) Yeah, the problem with your first query is that it's returning a rowset of arrays, not a single array. This means that ANY() doesn't know exactly what to do with it. -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco