Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much

Поиск
Список
Период
Сортировка
От Dmitry Dolgov
Тема Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much
Дата
Msg-id CA+q6zcWc=yE8XkOK+w58+sW_K+crFU-Xa48UKh5R0PFDEi6uEg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much
Список pgsql-bugs
> On 16 October 2017 at 02:08, Michael Paquier <michael.paquier@gmail.com> wrote:
>
>> Thanks for the patch. Everything looks fine, I just have one question -
>> maybe it makes sense to put this pattern `if (variadic) {/*...*/}` into a
>> separate function? Because from what I see it's basically one part of code
>> (I didn't spot any difference) repeated four times for every function.
>
> The json/jsonb calls have one difference though. For jsonb, arguments
> with unknown type are enforced to text, which is not the case of json,
> and we don't want to change that behavior.

Oh, actually what I meant is to put into a separate function only the first
branch of this condition, i.e. when `variadic` is true. But in general I don't
really have strong opinion about that, so if you think that this repetition is
not a problem, then fine.

> There is a common place for JSON-common code in jsonapi.c, but jsonapi.h is
> wanted as light-weight (see its set of headers), so moving things there is
> incorrect as well IMO.

Hm...did you mean `jsonfuncs.c` and `jsonapi.h`? It seems to me, that this
potential function (to handle `variadic` case) would not really pollute it.

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much