diff options
-rw-r--r-- | doc/src/sgml/xfunc.sgml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index a6d2a1355c6..e14854def0c 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -706,6 +706,20 @@ SELECT mleast(VARIADIC ARRAY[10, -1, 5, 4.4]); </para> <para> + Specifying <literal>VARIADIC</> in the call is also the only way to + pass an empty array to a variadic function, for example: + +<screen> +SELECT mleast(VARIADIC ARRAY[]::numeric[]); +</screen> + + Simply writing <literal>SELECT mleast()</> does not work because a + variadic parameter must match at least one actual argument. + (You could define a second function also named <literal>mleast</>, + with no parameters, if you wanted to allow such calls.) + </para> + + <para> The array element parameters generated from a variadic parameter are treated as not having any names of their own. This means it is not possible to call a variadic function using named arguments (<xref |