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