Re: fix - function call with variadic parameter for type "any"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: fix - function call with variadic parameter for type "any"
Дата
Msg-id 26576.1238704765@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: fix - function call with variadic parameter for type "any"  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: fix - function call with variadic parameter for type "any"  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> actually, there isn't any difference between a) and b)

> a) select somevariadicwithany(10);
> b) select somevariadicwithany(variadic 10);

> in this case the keyword VARIADIC is ignored.

Well, in my mind what the VARIADIC keyword does is it prevents the parser
from building an ARRAY[] expression around the remaining parameters.
Which would be incorrect for a VARIADIC ANY function because such a
function presumably doesn't want to force all the actual arguments
to be the same type --- if it did, it could use VARIADIC ANYARRAY.

VARIADIC ANY basically exists to allow an ANY-argument function to
accept any number of ANY parameters.  As such, PG_NARGS() is all it
really needs to know, plus the already-existing support for obtaining
the parameters' actual datatypes.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: [COMMITTERS] pgsql: If we expect a hash join to be performed in multiple batches,
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Additional DTrace Probes