Tom Lane <tgl@sss.pgh.pa.us> writes:
> This was discussed before --- see the archives. I believe the
> conclusion was that the results would actually be nondeterministic
> if we used two sort steps (that's what the code comment means by
> "rather unpredictable").
Does the non-determinism you're referring to result from an ORDER BY
on a non-deterministic expression, or the non-determinism that results
from picking an effectively random row because the ORDER BY isn't
sufficient?
I searched the archives and found Stephen Szabo's comment[1] that:
The query you've written is potential non-deterministic if you have a people_id that has multiple rows with different
lastnames that meet the where clause.
Which seems like an unconvincing justification for rejecting the
query: we accept DISTINCT ON with no ORDER BY clause at all, for
example.
-Neil
[1] http://archives.postgresql.org/pgsql-hackers/2001-07/msg00588.php