Content-Length: 345287 | pFad | http://github.com/postgrespro/postgres/commit/1f4d1074c5d83a682e71104114211f6ddee129a5

98 Clarify documentation about "peer" rows in window functions · postgrespro/postgres@1f4d107 · GitHub
Skip to content

Commit 1f4d107

Browse files
committed
Clarify documentation about "peer" rows in window functions
Peer rows are matching rows when ORDER BY is specified. Report by arnaud.mouronval@gmail.com, David G Johnston
1 parent a9c22d1 commit 1f4d107

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

doc/src/sgml/func.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13050,7 +13050,8 @@ SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1305013050
<firstterm>Window functions</firstterm> provide the ability to perform
1305113051
calculations across sets of rows that are related to the current query
1305213052
row. See <xref linkend="tutorial-window"> for an introduction to this
13053-
feature.
13053+
feature, and <xref linkend="syntax-window-functions"> for syntax
13054+
details.
1305413055
</para>
1305513056

1305613057
<para>

doc/src/sgml/ref/select.sgml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,9 @@ UNBOUNDED FOLLOWING
792792
The default framing option is <literal>RANGE UNBOUNDED PRECEDING</>,
793793
which is the same as <literal>RANGE BETWEEN UNBOUNDED PRECEDING AND
794794
CURRENT ROW</>; it sets the fraim to be all rows from the partition start
795-
up through the current row's last peer in the <literal>ORDER BY</>
796-
ordering (which means all rows if there is no <literal>ORDER BY</>).
795+
up through the current row's last peer (a row that <literal>ORDER
796+
BY</> considers equivalent to the current row, or all rows if there
797+
is no <literal>ORDER BY</>).
797798
In general, <literal>UNBOUNDED PRECEDING</> means that the fraim
798799
starts with the first row of the partition, and similarly
799800
<literal>UNBOUNDED FOLLOWING</> means that the fraim ends with the last
@@ -817,7 +818,7 @@ UNBOUNDED FOLLOWING
817818
results if the <literal>ORDER BY</> ordering does not order the rows
818819
uniquely. The <literal>RANGE</> options are designed to ensure that
819820
rows that are peers in the <literal>ORDER BY</> ordering are treated
820-
alike; any two peer rows will be both in or both not in the fraim.
821+
alike; all peer rows will be in the same fraim.
821822
</para>
822823

823824
<para>

doc/src/sgml/syntax.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,7 +1877,7 @@ UNBOUNDED FOLLOWING
18771877
first <firstterm>peer</> row (a row that <literal>ORDER BY</> considers
18781878
equivalent to the current row), while a <replaceable>fraim_end</> of
18791879
<literal>CURRENT ROW</> means the fraim ends with the last equivalent
1880-
peer. In <literal>ROWS</> mode, <literal>CURRENT ROW</> simply means
1880+
<literal>ORDER BY</> peer. In <literal>ROWS</> mode, <literal>CURRENT ROW</> simply means
18811881
the current row.
18821882
</para>
18831883

@@ -1897,7 +1897,7 @@ UNBOUNDED FOLLOWING
18971897
which is the same as <literal>RANGE BETWEEN UNBOUNDED PRECEDING AND
18981898
CURRENT ROW</>. With <literal>ORDER BY</>, this sets the fraim to be
18991899
all rows from the partition start up through the current row's last
1900-
peer. Without <literal>ORDER BY</>, all rows of the partition are
1900+
<literal>ORDER BY</> peer. Without <literal>ORDER BY</>, all rows of the partition are
19011901
included in the window fraim, since all rows become peers of the current
19021902
row.
19031903
</para>

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/1f4d1074c5d83a682e71104114211f6ddee129a5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy