X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E9CF752B31 for ; Sat, 30 Jul 2005 10:15:28 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39832-10 for ; Sat, 30 Jul 2005 13:15:17 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id A897052AAB for ; Sat, 30 Jul 2005 10:15:12 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j6UDF6NM031044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 30 Jul 2005 07:15:09 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j6UDF6wW065345; Sat, 30 Jul 2005 07:15:06 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j6UDF5Ce065344; Sat, 30 Jul 2005 07:15:05 -0600 (MDT) (envelope-from mfuhr) Date: Sat, 30 Jul 2005 07:15:05 -0600 From: Michael Fuhr To: Matthew Schumacher Cc: pgsql-sql@postgresql.org Subject: Re: How to loop though an array plpgsql? Message-ID: <20050730131505.GA65221@winnie.fuhr.org> References: <42EABE20.6040805@aptalaska.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42EABE20.6040805@aptalaska.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/249 X-Sequence-Number: 22227 On Fri, Jul 29, 2005 at 03:39:12PM -0800, Matthew Schumacher wrote: > I need to loop though an input array, but can't figure out how to do it, > the docs aren't really clear on this. This comes up from time to time -- search the archives to see past discussion. Suggestions usually involve array_lower() and array_upper(). http://archives.postgresql.org/ http://www.postgresql.org/docs/8.0/static/functions-array.html If you're using integers then see also the int_array_enum() function in the contrib/intagg module. -- Michael Fuhr http://www.fuhr.org/~mfuhr/