Re: proposal: fix corner use case of variadic fuctions usage

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: proposal: fix corner use case of variadic fuctions usage
Дата
Msg-id 4789.1358737304@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: proposal: fix corner use case of variadic fuctions usage  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: proposal: fix corner use case of variadic fuctions usage  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Sun, Jan 20, 2013 at 2:26 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Pavel is claiming it's okay for that to fall over if the array has
>> more than 100 elements.  I disagree, not only for the specific case of
>> CONCAT(), but with the more general implication that such a limitation
>> is going to be okay for any VARIADIC ANY function that anyone will ever
>> write.

> I don't know - how many of those will there really ever be?  I mean,
> people only write functions as VARIADIC as a notational convenience,
> don't they?  If you actually need to pass more than 100 separate
> pieces of data to a function, sending over 100+ parameters is almost
> certainly the Wrong Way To Do It.

Well, not necessarily, if they're reasonably expressed as an array.
I would also point out that there is no corresponding limitation on
variadic functions that take any type other than ANY.  Indeed, despite
Pavel's claim to the contrary, I'm pretty sure it's seen as a feature
that there's no specific upper limit to how many parameters you can pass
to a variadic function when using the "VARIADIC array-value" syntax.
It's certainly a feature that you can pass a varying number of
parameters that way, thereby "evading" the syntactic fact that you can't
pass a varying number of parameters any other way.  I don't see how
come it isn't a feature that you can "evade" the FUNC_MAX_ARGS limit
that way, or why we'd consider it acceptable for variably-sized
parameter arrays to have such a small arbitrary limit.
        regards, tom lane



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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: patch to add \watch to psql
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: CF3+4 (was Re: Parallel query execution)