why VARIADIC functions executed on array input? - Mailing list pgsql-general

From Tjibbe
Subject why VARIADIC functions executed on array input?
Date
Msg-id CAF_dx10Gr0DEbByJOMfZ5TVCsr26NxagV4bH6KX2u1pg+fPv=g@mail.gmail.com
Whole thread Raw
Responses Re: why VARIADIC functions executed on array input?  (Merlin Moncure <mmoncure@gmail.com>)
Re: why VARIADIC functions executed on array input?  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
CREATE FUNCTION foo (VARIADIC anyarray) RETURNS void AS $$
DECLARE
BEGIN
END
$$ LANGUAGE plpgsql;
SELECT foo (ARRAY[1]);

I would expect an error: Like:
ERROR: function f3oo(integer[]) does not exist

But I get this error:
ERROR: could not find array type for data type integer[]

Why VARIADIC functions are found on array input? In my opinion it
makes no sense and the disadvantage is that overloading with a
function like:  CREATE OR REPLACE FUNCTION foo (anyarray) doesn't
work.

Greetings Tjibbe

see example in: http://sqlfiddle.com/#!15/300e8/1



--
+31 6 29401726
tjibbe@rijpma.org
Jacobusstraat 185
3012 JM Rotterdam


pgsql-general by date:

Previous
From: Jürgen Fuchsberger
Date:
Subject: Re: File system level backup of shut down standby does not work?
Next
From: Dev Kumkar
Date:
Subject: Timezone information