Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wgdn2-0002zI-Nd for pgsql-bugs@arkaria.postgresql.org; Sat, 03 May 2014 17:31:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wgdn1-0001SE-UN for pgsql-bugs@arkaria.postgresql.org; Sat, 03 May 2014 17:31:55 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wgdn0-0001S7-UQ for pgsql-bugs@postgresql.org; Sat, 03 May 2014 17:31:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wgdmy-0001NA-6Z for pgsql-bugs@postgresql.org; Sat, 03 May 2014 17:31:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s43HVoYM029146; Sat, 3 May 2014 13:31:50 -0400 From: Tom Lane To: Marko Tiikkaja cc: vetri_2020@yahoo.com, pgsql-bugs@postgresql.org Subject: Re: BUG #10207: Simple select query returns duplicate row - Critical issue In-reply-to: <536525D4.2080809@joh.to> References: <20140503110401.1394.82717@wrigleys.postgresql.org> <536525D4.2080809@joh.to> Comments: In-reply-to Marko Tiikkaja message dated "Sat, 03 May 2014 19:22:28 +0200" Date: Sat, 03 May 2014 13:31:50 -0400 Message-ID: <29145.1399138310@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Marko Tiikkaja writes: > On 5/3/14, 1:04 PM, vetri_2020@yahoo.com wrote: >> I'd encountered an issue in select query when using order by and limit. >> >> When I sort by a column which have same values for some data,then the row >> that appears in first page also appears in next page. > This is not a bug. The sort order of identical values is undefined > unless disambiguated by adding more sort expressions. Somebody else asked this identical question just a couple days ago: http://www.postgresql.org/message-id/flat/20140428192320.2661.1832@wrigleys.postgresql.org It's not random in the sense of having any indeterminate behavior, but the output ordering of equal-keyed elements *can* change depending on the LIMIT value. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs