On Sat, 2006-03-04 at 21:21 -0500, Tom Lane wrote:
> 1. For each ORDER BY item:
> 1a. Find a matching GROUP BY item.
> (Break out of loop if no match.)
> 1b. Add it to the output list with ORDER BY item's ordering op.
> 1c. Remove the matched item from the GROUP BY list.
> 2. For each remaining GROUP BY item:
> 2a. Add it to output list using default ordering op.
Okay, attached is a revised patch that implements this. Barring any
objections I'll apply it tomorrow.
-Neil