--- doc/src/sgml/syntax.sgml.orig 2017-11-27 17:19:30.253810944 +0100 +++ doc/src/sgml/syntax.sgml 2017-11-27 17:20:55.515626931 +0100 @@ -1805,8 +1805,8 @@ and the optional frame_clause can be one of -{ RANGE | ROWS } frame_start [ frame_exclusion_clause ] -{ RANGE | ROWS } BETWEEN frame_start AND frame_end [ frame_exclusion_clause ] +{ RANGE | ROWS } frame_start [ frame_exclusion_clause ] +{ RANGE | ROWS } BETWEEN frame_start AND frame_end [ frame_exclusion_clause ] where frame_start and frame_end can be one of @@ -1817,7 +1817,7 @@ value FOLLOWING UNBOUNDED FOLLOWING - where the optional frame_exclusion_clause can be one of + where the optional frame_exclusion_clause can be one of EXCLUDE CURRENT ROW EXCLUDE TIES @@ -1888,24 +1888,24 @@ The value PRECEDING and - value FOLLOWING cases, when used - in ROWS mode, indicate that the frame starts or ends the specified - number of rows before or after the current row. In ROWS mode, - value must be an integer expression not containing any variables, + value FOLLOWING cases, when used + in ROWS mode, indicate that the frame starts or ends the specified + number of rows before or after the current row. In ROWS mode, + value must be an integer expression not containing any variables, aggregate functions, or window functions. - When used in RANGE mode, they indicate that the frame starts or ends when the value of - each row's ORDER BY column is within the start value and end value bounds. In RANGE mode, - value can be either an integer expression or a date/time interval. - In RANGE mode, there must be exactly one ORDER BY column and if the column is an integer column, - then value must be an integer. - If it is a date/time column, then value must be an interval. In both modes, + When used in RANGE mode, they indicate that the frame starts or ends when the value of + each row's ORDER BY column is within the start value and end value bounds. In RANGE mode, + value can be either an integer expression or a date/time interval. + In RANGE mode, there must be exactly one ORDER BY column and if the column is an integer column, + then value must be an integer. + If it is a date/time column, then value must be an interval. In both modes, the value must not be null or negative; but it can be zero, which just selects the current row. - For the frame_exclusion_clause, EXCLUDE CURRENT ROW - excludes the current row from the frame. EXCLUDE TIES excludes any peers of the current row from the - frame. EXCLUDE NO OTHERS does nothing, but is provided in order to optionally document the intention + For the frame_exclusion_clause, EXCLUDE CURRENT ROW + excludes the current row from the frame. EXCLUDE TIES excludes any peers of the current row from the + frame. EXCLUDE NO OTHERS does nothing, but is provided in order to optionally document the intention not to exclude any other rows.