Doc: update documentation for requirement of ORDER BY in GROUPS mode.
authorTom Lane
Thu, 12 Jul 2018 15:10:24 +0000 (11:10 -0400)
committerTom Lane
Thu, 12 Jul 2018 15:10:24 +0000 (11:10 -0400)
Commit ff4f88916 adjusted the code to enforce the SQL spec's requirement
that a window using GROUPS mode must have an ORDER BY clause.  But I missed
that the documentation explicitly said you didn't have to have one.

Also minor wordsmithing in the window-function section of select.sgml.

Per Masahiko Sawada, though I didn't use his patch.

doc/src/sgml/ref/select.sgml
doc/src/sgml/syntax.sgml

index 3d59b0c3e5a47d9f5118f05f99ec0f25cc679648..4db8142afaae944dee36a9573dbd2d0125d8b14d 100644 (file)
@@ -901,8 +901,8 @@ EXCLUDE NO OTHERS
     CURRENT ROW; it sets the frame to be all rows from the partition start
     up through the current row's last peer (a row
     that the window's ORDER BY clause considers
-    equivalent to the current row), or all rows if there
-    is no ORDER BY.
+    equivalent to the current row; all rows are peers if there
+    is no ORDER BY).
     In general, UNBOUNDED PRECEDING means that the frame
     starts with the first row of the partition, and similarly
     UNBOUNDED FOLLOWING means that the frame ends with the last
@@ -924,7 +924,7 @@ EXCLUDE NO OTHERS
     is an integer indicating that the frame starts or ends that many peer
     groups before or after the current row's peer group, where
     a peer group is a group of rows that are
-    equivalent according to ORDER BY.
+    equivalent according to the window's ORDER BY clause.
     In RANGE mode, use of
     an offset option requires that there be
     exactly one ORDER BY column in the window definition.
index f9905fb447bdb3c491c511792b79971a150a8b02..018118f6c7435a97a9c397ec94759ae6d3c50814 100644 (file)
@@ -1917,8 +1917,8 @@ EXCLUDE NO OTHERS
        ends the specified number of peer groups
        before or after the current row's peer group, where a peer group is a
        set of rows that are equivalent in the ORDER BY
-       ordering.  (If there is no ORDER BY, the whole
-       partition is one peer group.)
+       ordering.  (There must be an ORDER BY clause
+       in the window definition to use GROUPS mode.)