Skip to content

Commit 5e74a42

Browse files
committed
Document incompatibility of comparison expressions with VARIADIC array arguments
COALESCE, GREATEST and LEAST all look like functions taking variable numbers of arguments, but in fact they are not functions, and so VARIADIC array arguments don't work with them. Add a note to the docs explaining this fact. The consensus is not to try to make this work, but just to document the limitation. Discussion: https://postgr.es/m/CAFj8pRCaAtuXuRtvXf5GmPbAVriUQrNMo7-=TXUFN025S31R_w@mail.gmail.com
1 parent 32b8f0b commit 5e74a42

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/src/sgml/func.sgml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12481,6 +12481,15 @@ SELECT setval('foo', 42, false); <lineannotation>Next <function>nextval</func
1248112481
</para>
1248212482
</tip>
1248312483

12484+
<note>
12485+
<para>
12486+
Although <token>COALESCE</token>, <token>GREATEST</token>, and
12487+
<token>LEAST</token> are syntactically similar to functions, they are
12488+
not strictly functions, and thus cannot be used with explicit
12489+
<token>VARIADIC</token> array arguments.
12490+
</para>
12491+
</note>
12492+
1248412493
<sect2 id="functions-case">
1248512494
<title><literal>CASE</literal></title>
1248612495

0 commit comments

Comments
 (0)