consistent random order - Mailing list pgsql-sql

From Jeff Herrin
Subject consistent random order
Date
Msg-id 15697722.58781164818297562.JavaMail.root@srv161.carpathiahost.net
Whole thread Raw
Responses Re: consistent random order
Re: consistent random order
List pgsql-sql
<p>I am returning results ordered randomly using 'order by random()'. My issue has to do with page numbers in our web
application.When I hit the 2nd page and retrieve results with an offset, ordering by random() isn't really what I want
sinceI will often receive results that were on the 1st page (they get re-randomized).<br /><br />I'm looking for a
way toorder in a controled random order. Maybe a UDF. Ideally I would need to do this:<br /><br />ORDER BY
myRandomUDF(1234)<br/>or<br />ORDER BY myRandomUDF(2345)<p>Where the argument acts like a seed that always returns a
consistentpseudo-random set. That way, when I get to the 2nd page, i know i'm getting the dataset back in the same
orderthat I had on page 1, and the offset works like normal. Is this even realistically possible?<br /><br />Thanks,<br
/>JeffHerrin 

pgsql-sql by date:

Previous
From: Ragnar
Date:
Subject: Re: UNICODE and PL/PGSQL
Next
From: "Aaron Bono"
Date:
Subject: Re: consistent random order