• Tom Lane's avatar
    Fix EquivalenceClass code to handle volatile sort expressions in a more · c291203c
    Tom Lane authored
    predictable manner; in particular that if you say ORDER BY output-column-ref,
    it will in fact sort by that specific column even if there are multiple
    syntactic matches.  An example is
    	SELECT random() AS a, random() AS b FROM ... ORDER BY b, a;
    While the use-case for this might be a bit debatable, it worked as expected
    in earlier releases, so we should preserve the behavior for 8.3.  Per my
    recent proposal.
    
    While at it, fix convert_subquery_pathkeys() to handle RelabelType stripping
    in both directions; it needs this for the same reasons make_sort_from_pathkeys
    does.
    c291203c
tlist.c 5.77 KB