ROW or RANGE not optional in range specification

Started by David G. Johnstonabout 11 years ago2 messagesdocs
Jump to latest
#1David G. Johnston
david.g.johnston@gmail.com

http://www.postgresql.org/docs/devel/static/sql-select.html

Either I'm confused about the syntax description rules or the documentation
for this aspect of window definitions is wrong.

The expression:

[ RANGE | ROWS ] BETWEEN frame_start AND frame_end

means that the specification of range or rows is optional - but that
doesn't appear to be the case...

The documentation should read:

{ RANGE | ROWS } BETWEEN frame_start AND frame_end

Same goes for the bare frame_start specification preceding the between
version.

The bare version looks funny without tag but "ORDER BY idx BETWEEN 5
PRECEDING AND CURRENT ROW" isn't obviously wrong until you get a syntax
error...

David J.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: David G. Johnston (#1)
Re: ROW or RANGE not optional in range specification

"David G. Johnston" <david.g.johnston@gmail.com> writes:

Either I'm confused about the syntax description rules or the documentation
for this aspect of window definitions is wrong.

The expression:

[ RANGE | ROWS ] BETWEEN frame_start AND frame_end

means that the specification of range or rows is optional - but that
doesn't appear to be the case...

The documentation should read:

{ RANGE | ROWS } BETWEEN frame_start AND frame_end

Yup, you're right. Thanks for spotting that!

regards, tom lane

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs