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

From Tom Lane
Subject Re: ORDER BY vs. volatile functions
Date
Msg-id 23538.1258396284@sss.pgh.pa.us
Whole thread Raw
In response to Re: ORDER BY vs. volatile functions  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Responses Re: ORDER BY vs. volatile functions
List pgsql-hackers
Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
> [1] http://archives.postgresql.org/pgsql-general/2006-11/msg01544.php

FWIW, the behavior has changed from the time of that discussion ---
we now track sort ordering using EquivalenceClasses, which are able
to distinguish different instances of textually equal() volatile
expressions.  The particular cases ofselect random() from foo order by 1;select random() from foo order by random();
still behave the same, but that's intentional for backwards
compatibility (and because SQL99 forbids the first, which would mean
there's no way to get the behavior except via deprecated syntax).
Beyond the case of order by/group by items being matched to tlist
items, I'd generally expect that the system should act as though
different textual instances of random() are evaluated separately.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: next CommitFest
Next
From: Tom Lane
Date:
Subject: Re: ALTER TABLE...ALTER COLUMN vs inheritance