Re: Add json_object(text[], json[])?

Поиск
Список
Период
Сортировка
От Paul Jungwirth
Тема Re: Add json_object(text[], json[])?
Дата
Msg-id 7f99e6b8-1823-7738-2788-e97105d906af@illuminatedcomputing.com
обсуждение исходный текст
Ответ на Re: Add json_object(text[], json[])?  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Список pgsql-hackers
On 10/25/19 6:40 AM, Andrew Dunstan wrote:
> json{b}_build_object and json{b}_build_array are designed for creating
> nested json{b}. Not sure if they would work for your purpose.

Thanks for the suggestion! I looked at these a bit, but they only work 
if you have a known-ahead-of-time number of arguments. (I did explore 
building an array and calling jsonb_build_object using VARIADIC, but you 
can't build an array with alternating text & jsonb elements. That made 
me curious how these functions even worked, which led me to 
extract_variadic_args (utils/fmgr/funcapi.c), which has some magic to 
support heterogeneous types when not called with the VARIADIC keyword, 
so it seems they bypass the normal variadic handling.)

Regards,

-- 
Paul              ~{:-)
pj@illuminatedcomputing.com



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: [Proposal] Global temporary tables
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: fairywren failures