Re: Array with Subselect / ANY - cast? - Mailing list pgsql-general

From Josh Trutwin
Subject Re: Array with Subselect / ANY - cast?
Date
Msg-id 20070821144353.5c8412ca@sinkhole.intrcomm.net
Whole thread Raw
In response to Re: Array with Subselect / ANY - cast?  ("Pavel Stehule" <pavel.stehule@gmail.com>)
List pgsql-general
On Tue, 21 Aug 2007 21:36:00 +0200
"Pavel Stehule" <pavel.stehule@gmail.com> wrote:

> it works? no.
>
> pavel=# select 1 from (values(10)) a(i)  where i = any((select *
> from foo)::int[]);
> ERROR:  cannot cast type integer to integer[]
> LINE 1: ...values(10)) a(i)  where i = any((select * from
> foo)::int[]); ^
> pavel=#

oops - forgot to send to list:

This is the exact query I ran which produces a result set:

select * from tblproducts
where productid = ANY(
   (select pb_correspondence from pb.pb_nurse
     where id = 140)::integer[]
)
order by productid;

Your query looks similar - maybe it's the "select *" in the subquery?

Either way I actually found a better way to do what I was trying to
do here so no worries.  :)

Josh

pgsql-general by date:

Previous
From: "Dmitry Koterov"
Date:
Subject: Re: Need help doing a PostgreSQL vs Firebird feature comparison
Next
From: "Ed L."
Date:
Subject: Re: history table