Re: Aggregate ORDER BY patch
Andrew Gierth <andrew@tao11.riddles.org.uk>
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Hitoshi Harada <umi.tanuki@gmail.com>, pgsql-hackers@postgresql.org
Date: 2009-11-16T05:04:50Z
Lists: pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes: >> What about error handling? If the user specifies agg(distinct x) >> where x is not sortable, do we leave it to the planner to detect >> that (which means not reporting the error position?) Tom> Well, at the moment there's only going to be a sort-based Tom> implementation, so I don't object to throwing an error for that Tom> as soon as possible. OTOH I wouldn't recommend expending a lot Tom> of code to do it there. I would hope that most of the parser's Tom> work for this can be shared with the existing support for Tom> query-level ORDER BY/DISTINCT. The code already uses transformSortClause for most of the work, but reusing the existing code for DISTINCT would have required more refactoring than I was happy with, because transformDistinct etc. all have error message text which is specific to SELECT DISTINCT etc. Let's see how it falls out in the next patch. -- Andrew.