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

Commitfc3649f

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 parentfe939d9 commitfc3649f

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
@@ -13216,9 +13216,9 @@ SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1321613216
<primary>lag</primary>
1321713217
</indexterm>
1321813218
<function>
13219-
lag(<replaceable class="parameter">value</replaceable> <type>any</>
13219+
lag(<replaceable class="parameter">value</replaceable> <type>anyelement</>
1322013220
[, <replaceable class="parameter">offset</replaceable> <type>integer</>
13221-
[, <replaceable class="parameter">default</replaceable> <type>any</> ]])
13221+
[, <replaceable class="parameter">default</replaceable> <type>anyelement</> ]])
1322213222
</function>
1322313223
</entry>
1322413224
<entry>
@@ -13228,7 +13228,9 @@ SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1322813228
returns <replaceable class="parameter">value</replaceable> evaluated at
1322913229
the row that is <replaceable class="parameter">offset</replaceable>
1323013230
rows before the current row within the partition; if there is no such
13231-
row, instead return <replaceable class="parameter">default</replaceable>.
13231+
row, instead return <replaceable class="parameter">default</replaceable>
13232+
(which must be of the same type as
13233+
<replaceable class="parameter">value</replaceable>).
1323213234
Both <replaceable class="parameter">offset</replaceable> and
1323313235
<replaceable class="parameter">default</replaceable> are evaluated
1323413236
with respect to the current row. If omitted,
@@ -13243,9 +13245,9 @@ SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1324313245
<primary>lead</primary>
1324413246
</indexterm>
1324513247
<function>
13246-
lead(<replaceable class="parameter">value</replaceable> <type>any</>
13248+
lead(<replaceable class="parameter">value</replaceable> <type>anyelement</>
1324713249
[, <replaceable class="parameter">offset</replaceable> <type>integer</>
13248-
[, <replaceable class="parameter">default</replaceable> <type>any</> ]])
13250+
[, <replaceable class="parameter">default</replaceable> <type>anyelement</> ]])
1324913251
</function>
1325013252
</entry>
1325113253
<entry>
@@ -13255,7 +13257,9 @@ SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1325513257
returns <replaceable class="parameter">value</replaceable> evaluated at
1325613258
the row that is <replaceable class="parameter">offset</replaceable>
1325713259
rows after the current row within the partition; if there is no such
13258-
row, instead return <replaceable class="parameter">default</replaceable>.
13260+
row, instead return <replaceable class="parameter">default</replaceable>
13261+
(which must be of the same type as
13262+
<replaceable class="parameter">value</replaceable>).
1325913263
Both <replaceable class="parameter">offset</replaceable> and
1326013264
<replaceable class="parameter">default</replaceable> are evaluated
1326113265
with respect to the current row. If omitted,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp