>>>>> "Tom" == Tom Lane <t...@sss.pgh.pa.us> writes:

 Tom> Ron Mayer <rm...@cheapcomplexdevices.com> writes:
 >> [1] http://archives.postgresql.org/pgsql-general/2006-11/msg01544.php

 Tom> FWIW, the behavior has changed from the time of that discussion ---
 Tom> we now track sort ordering using EquivalenceClasses, which are able
 Tom> to distinguish different instances of textually equal() volatile
 Tom> expressions.  The particular cases of
 Tom>   select random() from foo order by 1;
 Tom>   select random() from foo order by random();
 Tom> still behave the same, but that's intentional for backwards
 Tom> compatibility (and because SQL99 forbids the first, which would mean
 Tom> there's no way to get the behavior except via deprecated syntax).

SQL99 doesn't forbid:

select random() as r from foo order by r;

or

select r from (select random() as r from foo) as s order by r;

-- 
Andrew (irc:RhodiumToad)

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to