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

Appearance settings

Commit 699300a

Browse filesBrowse files
committed
Docs: clarify treatment of variadic functions with zero variadic arguments.
Explain that you have to use "VARIADIC ARRAY[]" to pass an empty array to a variadic parameter position. This was already implicit in the text but it seems better to spell it out. Per a suggestion from David Johnston, though I didn't use his proposed wording. Back-patch to all supported branches.
1 parent 2ef6c66 commit 699300a
Copy full SHA for 699300a

File tree

Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed

‎doc/src/sgml/xfunc.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/xfunc.sgml
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,20 @@ SELECT mleast(VARIADIC ARRAY[10, -1, 5, 4.4]);
754754
actual argument of a function call.
755755
</para>
756756

757+
<para>
758+
Specifying <literal>VARIADIC</> in the call is also the only way to
759+
pass an empty array to a variadic function, for example:
760+
761+
<screen>
762+
SELECT mleast(VARIADIC ARRAY[]::numeric[]);
763+
</screen>
764+
765+
Simply writing <literal>SELECT mleast()</> does not work because a
766+
variadic parameter must match at least one actual argument.
767+
(You could define a second function also named <literal>mleast</>,
768+
with no parameters, if you wanted to allow such calls.)
769+
</para>
770+
757771
<para>
758772
The array element parameters generated from a variadic parameter are
759773
treated as not having any names of their own. This means it is not

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.