"Hitoshi Harada" <umi.tan...@gmail.com> writes: > 2008/12/30 Tom Lane <t...@sss.pgh.pa.us>: >> What is the difference? AFAICS the RANGE and ROWS keywords ought to be >> equivalent if you are not specifying "expression PRECEDING" or >> "expression FOLLOWING".
> The difference is that RANGE ... CURRENT ROW contains all peers of the > current row, while ROWS ... CURRENT ROW doesn't contain them but the > current row itself only. See 7.11 rule 5-b. Hah, I had missed that fine point. Okay, doc is wrong and I will fix. Given that, I think that a suitable minimum implementation should cover both the RANGE/ROWS distinction and the CURRENT ROW/UNBOUNDED FOLLOWING distinction, ie I would like 8.4 to support RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING (1 is the default, 2 and 4 behave the same unless I'm still missing something.) This doesn't seem too difficult to consider adding now, and it will greatly increase the usefulness of frame-dependent window functions. Is this something you're interested in working on? I can tackle it if you don't have time now. 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