diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-07-12 11:10:24 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-07-12 11:10:33 -0400 |
commit | 663060e8c3832ea8388e4ae128420f76680e5fe9 (patch) | |
tree | e8e3bddc3f5fa78a1609ea0fe1c451149ed76626 | |
parent | 0527df732beb8c2d584c7e4ea5aeb05cf92e14a2 (diff) | |
download | postgresql-663060e8c3832ea8388e4ae128420f76680e5fe9.tar.gz postgresql-663060e8c3832ea8388e4ae128420f76680e5fe9.zip |
Doc: update documentation for requirement of ORDER BY in GROUPS mode.
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.
-rw-r--r-- | doc/src/sgml/ref/select.sgml | 6 | ||||
-rw-r--r-- | doc/src/sgml/syntax.sgml | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index 3d59b0c3e5a..4db8142afaa 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -901,8 +901,8 @@ EXCLUDE NO OTHERS CURRENT ROW</literal>; it sets the frame to be all rows from the partition start up through the current row's last <firstterm>peer</firstterm> (a row that the window's <literal>ORDER BY</literal> clause considers - equivalent to the current row), or all rows if there - is no <literal>ORDER BY</literal>. + equivalent to the current row; all rows are peers if there + is no <literal>ORDER BY</literal>). In general, <literal>UNBOUNDED PRECEDING</literal> means that the frame starts with the first row of the partition, and similarly <literal>UNBOUNDED FOLLOWING</literal> 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 <firstterm>peer group</firstterm> is a group of rows that are - equivalent according to <literal>ORDER BY</literal>. + equivalent according to the window's <literal>ORDER BY</literal> clause. In <literal>RANGE</literal> mode, use of an <replaceable>offset</replaceable> option requires that there be exactly one <literal>ORDER BY</literal> column in the window definition. diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml index f9905fb447b..018118f6c74 100644 --- a/doc/src/sgml/syntax.sgml +++ b/doc/src/sgml/syntax.sgml @@ -1917,8 +1917,8 @@ EXCLUDE NO OTHERS ends the specified number of <firstterm>peer groups</firstterm> before or after the current row's peer group, where a peer group is a set of rows that are equivalent in the <literal>ORDER BY</literal> - ordering. (If there is no <literal>ORDER BY</literal>, the whole - partition is one peer group.) + ordering. (There must be an <literal>ORDER BY</literal> clause + in the window definition to use <literal>GROUPS</literal> mode.) </para> </listitem> <listitem> |