>>>>> "Tom" == Tom Lane <t...@sss.pgh.pa.us> writes:
>> I wonder if it would be worth adding a run-time check in >> window_ntile() that causes an ERROR on first call if there are any >> Vars or PARAM_EXEC Params in the function argument. An ERROR might >> be better than doing something that the user does not expect. Tom> -1, that would break cases that are legal and useful, such as Tom> where a PARAM_EXEC Param represents an outer-query-level variable, Tom> while still failing to catch some problematic cases (eg. volatile Tom> functions). The only sane run-time check (that I can think of) that could be applied would be to check that the value is the same on each row of a partition. Tom> I think also that there are cases that are not legal per spec but Tom> can still be useful, as long as the user knows what they're doing. Yes, it would make sense for example to allow the value to change between partitions. -- Andrew (irc:RhodiumToad)