Re: imploding/using arrays for IN (...) - Mailing list pgsql-general

From Stephan Szabo
Subject Re: imploding/using arrays for IN (...)
Date
Msg-id 20021017184259.Q17274-100000@megazone23.bigpanda.com
Whole thread Raw
In response to imploding/using arrays for IN (...)  (Cool Screen <cool_screen_name90001@yahoo.com>)
List pgsql-general
On Thu, 17 Oct 2002, Cool Screen wrote:

> Passing an array to a PL/pgSQL function, is it
> possible to implode it and use with IN (...) ? For
> example:
>
> my_func(int[])
>  ids := implode_func($1);
>
>  select *
>  from x
>  where id in (ids);
>
>
> I tried concatenating ids together with ',', but the
> query gives an integer/text cast error. Or, is it
> possible use arrays in IN()?

Not really, but you may want to look at contrib/array
for some functions/operators that do item in array
lookups.


pgsql-general by date:

Previous
From: "Roberto (SmartBit)"
Date:
Subject: Finding a value in an array field
Next
From: Tom Lane
Date:
Subject: Re: Query performance with small data base