"Hitoshi Harada" <umi.tan...@gmail.com> writes: > 2008/12/28 David Rowley <dgrow...@gmail.com>: >> I've started running my test queries that I used when reviewing the patch. >> The following crashes the backend:
> It seems that parseCheckWindowFuncs() doesn't check CTE case whereas > parseCheckAggregates() checks it, including check of window functions. > So the urgent patch is as following, but is this operation allowed? I > am blind in CTE rules... Well, this certainly demonstrates that the check I added to parseCheckAggregates is wrongly placed, but I'm not sure we really need to forbid the case. David's example query seems to give sane answers once the bug in begin_partition is fixed: parentpart | childpart | quantity | rn ------------+-----------+----------+---- KITCHEN | TABLE | 1 | 1 KITCHEN | COOKER | 1 | 2 KITCHEN | FRIDGE | 1 | 3 TABLE | CHAIR | 4 | 1 CHAIR | LEG | 4 | 1 (5 rows) I basically went around and made sure everyplace that threw an error for aggregates also threw one for window functions, but it's quite possible that that's overly restrictive in some places. Window functions don't cause grouping so there's no reason to forbid them in places where it's the grouping behavior that is objectionable. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers