Re: BUG #10207: Simple select query returns duplicate row - Critical issue - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #10207: Simple select query returns duplicate row - Critical issue
Date
Msg-id 29145.1399138310@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #10207: Simple select query returns duplicate row - Critical issue  (Marko Tiikkaja <marko@joh.to>)
List pgsql-bugs
Marko Tiikkaja <marko@joh.to> 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

pgsql-bugs by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: BUG #10207: Simple select query returns duplicate row - Critical issue
Next
From: David G Johnston
Date:
Subject: Re: BUG #10207: Simple select query returns duplicate row - Critical issue