X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E6E589FB1B9 for ; Tue, 18 Jul 2006 14:27:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 62608-02-5 for ; Tue, 18 Jul 2006 14:27:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 9A4A59FB1D9 for ; Tue, 18 Jul 2006 14:16:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k6IHFSnx005377; Tue, 18 Jul 2006 13:15:28 -0400 (EDT) To: Curtis Scheer cc: pgsql-sql@postgresql.org Subject: Re: How to pass array of values to a stored procedure In-reply-to: <031936836C46D611BB1B00508BE7345D048DAAB8@gatekeeper.daycos.com> References: <031936836C46D611BB1B00508BE7345D048DAAB8@gatekeeper.daycos.com> Comments: In-reply-to Curtis Scheer message dated "Tue, 18 Jul 2006 09:26:30 -0500" Date: Tue, 18 Jul 2006 13:15:28 -0400 Message-ID: <5376.1153242928@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/233 X-Sequence-Number: 25807 Curtis Scheer 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