Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D7057632805 for ; Thu, 25 Mar 2010 13:12:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 33634-06 for ; Thu, 25 Mar 2010 16:12:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail43.e.nsc.no (mail43.e.nsc.no [193.213.115.43]) by mail.postgresql.org (Postfix) with ESMTP id A3136632636 for ; Thu, 25 Mar 2010 13:12:43 -0300 (ADT) Received: from balapapa.localnet (42.185.16.62.customer.cdi.no [62.16.185.42]) (authenticated bits=0) by mail43.nsc.no (8.14.3/8.14.3) with ESMTP id o2PFGrec001351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 25 Mar 2010 16:16:54 +0100 (MET) From: Leif Biberg Kristensen To: postgresql Subject: Plpgsql: Iterating through a string of parameters Date: Thu, 25 Mar 2010 16:16:53 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.27-gentoo-r10; KDE/4.3.5; i686; ; ) MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003251616.53097.leif@solumslekt.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.522 tagged_above=-10 required=5 tests=AWL=0.077, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/188 X-Sequence-Number: 33895 I'm struggling with how to make plpgsql iterate through a list of numbers input as a text string, eg. "1438 2656 973 4208". I figure that I can use the regexp_split_to_array() function to make an array of the string, but can I iterate through an array with eg. a FOR loop? regards, -- Leif Biberg Kristensen http://solumslekt.org/