Re: imploding/using arrays for IN (...)

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Cool Screen <cool_screen_name90001(at)yahoo(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: imploding/using arrays for IN (...)
Date: 2002-10-18 01:43:50
Message-ID: 20021017184259.Q17274-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-10-18 01:51:09 Re: Query performance with small data base
Previous Message Roberto (SmartBit) 2002-10-18 00:45:50 Finding a value in an array field