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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Vik Reykja <vikreykja(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: fix corner use case of variadic fuctions usage
Date: 2013-01-20 20:10:26
Message-ID: CAFj8pRDxZMrdvnKVk7H=+p2ynRLGF52nkqAxJOdyewcfw+LkEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hello

2013/1/20 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Sat, Jan 19, 2013 at 3:27 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> That's utter nonsense. Why wouldn't people expect concat(), for
>>> example, to work for large (or even just moderate-sized) arrays?
>
>> /me blinks.
>
>> What does that have to do with anything? IIUC, the question isn't
>> whether CONCAT() would work for large arrays, but rather for very
>> large numbers of arrays written out as CONCAT(a1, ..., a10000000).
>
> No, the question is what happens with CONCAT(VARIADIC some-array-here),
> which currently just returns the array as-is, but which really ought
> to concat all the array elements as if they'd been separate arguments.
>
> 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 am sending patch that is based on last Tom's proposal

it missing some small fixes for other variadic "any" functions concat,
concat_ws - I'll send it tomorrow

Regards

Pavel

> regards, tom lane

Attachment Content-Type Size
variadic_any_fix.patch application/octet-stream 19.4 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-01-20 20:21:10 Re: proposal: fix corner use case of variadic fuctions usage
Previous Message Kevin Grittner 2013-01-20 20:08:45 Re: not(t_xmax = 0)

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-01-20 20:18:34 Re: CF3+4 (was Re: Parallel query execution)
Previous Message Phil Sorber 2013-01-20 19:59:04 Re: [WIP] pg_ping utility