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

Commitb27679a

Browse files
committed
Docs: clarify treatment of variadic functions with zero variadic arguments.
Explain that you have to use "VARIADIC ARRAY[]" to pass an empty arrayto a variadic parameter position. This was already implicit in the textbut it seems better to spell it out.Per a suggestion from David Johnston, though I didn't use his proposedwording. Back-patch to all supported branches.
1 parentfce3a71 commitb27679a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎doc/src/sgml/xfunc.sgml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,20 @@ SELECT mleast(VARIADIC ARRAY[10, -1, 5, 4.4]);
699699
actual argument of a function call.
700700
</para>
701701

702+
<para>
703+
Specifying <literal>VARIADIC</> in the call is also the only way to
704+
pass an empty array to a variadic function, for example:
705+
706+
<screen>
707+
SELECT mleast(VARIADIC ARRAY[]::numeric[]);
708+
</screen>
709+
710+
Simply writing <literal>SELECT mleast()</> does not work because a
711+
variadic parameter must match at least one actual argument.
712+
(You could define a second function also named <literal>mleast</>,
713+
with no parameters, if you wanted to allow such calls.)
714+
</para>
715+
702716
<para>
703717
The array element parameters generated from a variadic parameter are
704718
treated as not having any names of their own. This means it is not

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp