Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGEBJ-0003v9-Jf for pgsql-sql@arkaria.postgresql.org; Wed, 19 Feb 2014 20:55:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WGEBI-0003D6-V2 for pgsql-sql@arkaria.postgresql.org; Wed, 19 Feb 2014 20:55:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGEBG-00039f-In for pgsql-sql@postgresql.org; Wed, 19 Feb 2014 20:55:46 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGEBD-0008Uq-E9 for pgsql-sql@postgresql.org; Wed, 19 Feb 2014 20:55:46 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1WGEBC-0003X8-Bi for pgsql-sql@postgresql.org; Wed, 19 Feb 2014 12:55:42 -0800 Date: Wed, 19 Feb 2014 12:55:42 -0800 (PST) From: AlexK To: pgsql-sql@postgresql.org Message-ID: <1392843342351-5792787.post@n5.nabble.com> In-Reply-To: References: <1392837956043-5792770.post@n5.nabble.com> <1392838343105-5792771.post@n5.nabble.com> <1392839868185-5792774.post@n5.nabble.com> Subject: Re: How to unnest an array with element indexes MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Pavel, This works for me, thank you! Presumably foreach is guaranteed to iterate array elements in order: "The elements are visited in storage order, regardless of the number of array dimensions", quoted from this: http://www.postgresql.org/docs/9.2/static/plpgsql-control-structures.html Since parallelism is coming up, will this behavior stay as documented? My arrays are as big as 20K-30K elements, maybe more. -- View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-unnest-an-array-with-element-indexes-tp5792770p5792787.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql