Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Upcpp-0005I5-UZ for pgsql-sql@arkaria.postgresql.org; Thu, 20 Jun 2013 11:15:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Upcpp-0004wn-DX for pgsql-sql@arkaria.postgresql.org; Thu, 20 Jun 2013 11:15:25 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Upcpo-0004vU-6X for pgsql-sql@postgresql.org; Thu, 20 Jun 2013 11:15:24 +0000 Received: from adsltrust.ath.forthnet.gr ([194.219.204.174] helo=smadev.internal.net) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Upcpg-0007F0-Ek for pgsql-sql@postgresql.org; Thu, 20 Jun 2013 11:15:23 +0000 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.14.5/8.14.5) with ESMTP id r5KBFDtI019531 for ; Thu, 20 Jun 2013 14:15:13 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Message-ID: <51C2E441.4020200@matrix.gatewaynet.com> Date: Thu, 20 Jun 2013 14:15:13 +0300 From: Achilleas Mantzios User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130601 Thunderbird/17.0.6 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: UNNEST result order vs Array data References: <1371724857304-5760087.post@n5.nabble.com> <51C2DD42.4000002@dalibo.com> In-Reply-To: <51C2DD42.4000002@dalibo.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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 On 20/06/2013 13:45, Vik Fearing wrote: > On 06/20/2013 12:40 PM, gmb wrote: >> Hi all >> I just want to confirm something regarding UNNEST function used with arrays. >> I cannot see that it is specifically mentioned in the documentation , but >> maybe because it is obvious. >> >> Is the order of the result guaranteed to be the order of the array > Order is never guaranteed unless you specify an ORDER BY clause. > > I really think that the order should exactly reflect the order in the array. Think of ARRAY as Relation + ORDER. Relation + Order gives an ARRAY, ARRAY should give Relation *and* ORDER in return. -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql