Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23ddcd7

Browse files
committed
Docs: be explicit about datatype matching for lead/lag functions.
The default argument, if given, has to be of exactly the same datatypeas the first argument; but this was not stated in so many words, andthe error message you get about it might not lead your thought in theright direction. Per bug #13587 from Robert McGehee.A quick scan says that these are the only two built-in functions with twoanyelement arguments and no other polymorphic arguments. There are plentyof cases of, eg, anyarray and anyelement, but those seem less likely toconfuse. For instance this doesn't seem terribly hard to figure out:"function array_remove(integer[], numeric) does not exist". So I'vecontented myself with fixing these two cases.
1 parent7c57449 commit23ddcd7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10603,9 +10603,9 @@ SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1060310603
<primary>lag</primary>
1060410604
</indexterm>
1060510605
<function>
10606-
lag(<replaceable class="parameter">value</replaceable> <type>any</>
10606+
lag(<replaceable class="parameter">value</replaceable> <type>anyelement</>
1060710607
[, <replaceable class="parameter">offset</replaceable> <type>integer</>
10608-
[, <replaceable class="parameter">default</replaceable> <type>any</> ]])
10608+
[, <replaceable class="parameter">default</replaceable> <type>anyelement</> ]])
1060910609
</function>
1061010610
</entry>
1061110611
<entry>
@@ -10615,7 +10615,9 @@ SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1061510615
returns <replaceable class="parameter">value</replaceable> evaluated at
1061610616
the row that is <replaceable class="parameter">offset</replaceable>
1061710617
rows before the current row within the partition; if there is no such
10618-
row, instead return <replaceable class="parameter">default</replaceable>.
10618+
row, instead return <replaceable class="parameter">default</replaceable>
10619+
(which must be of the same type as
10620+
<replaceable class="parameter">value</replaceable>).
1061910621
Both <replaceable class="parameter">offset</replaceable> and
1062010622
<replaceable class="parameter">default</replaceable> are evaluated
1062110623
with respect to the current row. If omitted,
@@ -10630,9 +10632,9 @@ SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1063010632
<primary>lead</primary>
1063110633
</indexterm>
1063210634
<function>
10633-
lead(<replaceable class="parameter">value</replaceable> <type>any</>
10635+
lead(<replaceable class="parameter">value</replaceable> <type>anyelement</>
1063410636
[, <replaceable class="parameter">offset</replaceable> <type>integer</>
10635-
[, <replaceable class="parameter">default</replaceable> <type>any</> ]])
10637+
[, <replaceable class="parameter">default</replaceable> <type>anyelement</> ]])
1063610638
</function>
1063710639
</entry>
1063810640
<entry>
@@ -10642,7 +10644,9 @@ SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1064210644
returns <replaceable class="parameter">value</replaceable> evaluated at
1064310645
the row that is <replaceable class="parameter">offset</replaceable>
1064410646
rows after the current row within the partition; if there is no such
10645-
row, instead return <replaceable class="parameter">default</replaceable>.
10647+
row, instead return <replaceable class="parameter">default</replaceable>
10648+
(which must be of the same type as
10649+
<replaceable class="parameter">value</replaceable>).
1064610650
Both <replaceable class="parameter">offset</replaceable> and
1064710651
<replaceable class="parameter">default</replaceable> are evaluated
1064810652
with respect to the current row. If omitted,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp