Re: ORDER BY vs. volatile functions - Mailing list pgsql-hackers

From Ron Mayer
Subject Re: ORDER BY vs. volatile functions
Date
Msg-id 4B014369.9040609@cheapcomplexdevices.com
Whole thread Raw
In response to ORDER BY vs. volatile functions  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: ORDER BY vs. volatile functions
List pgsql-hackers
Andrew Gierth wrote:
> This query:
> 
> select random() from generate_series(1,10) order by random();
> produces sorted output. Should it?

I recall a workaround from a different thread[1] if specifically
were looking for random ordering of random numbers is:select random() from foo order by random()+1;

The thread has more odd corner cases with multiple calls
to random() and sorts as well.


[1] http://archives.postgresql.org/pgsql-general/2006-11/msg01544.php



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: named parameters in SQL functions
Next
From: Mark Pith
Date:
Subject: Academic research on programmers' motivation