Re: How to pass array of values to a stored procedure

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Curtis Scheer <Curtis(at)DAYCOS(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to pass array of values to a stored procedure
Date: 2006-07-18 17:15:28
Message-ID: 5376.1153242928@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Curtis Scheer <Curtis(at)DAYCOS(dot)com> writes:
> Does anyone have any examples of how I would make a stored procedure in
> plpgsql that would allow for passing a list or arrays of values to be used
> in an sql IN clause? Like so: select * from table where field1 in (values).

Probably the "field1 = ANY (arrayvalue)" syntax is what you want. Note
however that this can't be turned into an indexscan on field1 in existing
releases (8.2 will be able to do it).

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tony Wasson 2006-07-18 17:24:36 Re: How to pass array of values to a stored procedure
Previous Message Bricklen Anderson 2006-07-18 16:44:50 Re: hi let me know the solution to this question