Re: proposal: fix corner use case of variadic fuctions usage - Mailing list pgsql-hackers

From Tom Lane
Subject Re: proposal: fix corner use case of variadic fuctions usage
Date
Msg-id 9365.1358926133@sss.pgh.pa.us
Whole thread Raw
In response to Re: proposal: fix corner use case of variadic fuctions usage  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal: fix corner use case of variadic fuctions usage
Re: proposal: fix corner use case of variadic fuctions usage
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> what should be result of concat(variadic NULL::int[])
> I enabled this use case, but what should be result?

I think there are two somewhat defensible theories:

(1) punt, and return NULL overall.  So in this case the variadic
function would act as if it were STRICT.  That seems a bit weird though
if the function is not strict otherwise.

(2) Treat the NULL as if it were a zero-length array, giving rise to
zero ordinary parameters.  This could be problematic if the function
can't cope very well with zero parameters ... but on the other hand,
if it can't do so, then what will it do with VARIADIC '{}'::int[] ?

I lean a little bit towards (2) but it's definitely a judgment call.
Anybody have any other arguments one way or the other?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: fix corner use case of variadic fuctions usage
Next
From: Alexander Korotkov
Date:
Subject: Re: WIP: index support for regexp search