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

Поиск
Список
Период
Сортировка
От Paul A Jungwirth
Тема Re: Add json_object(text[], json[])?
Дата
Msg-id CA+renyVEcQ-kVkL+N4jwhrycfsGCgFz_RD6CD=8oMeuRA9EgCQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add json_object(text[], json[])?  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
Ответы Re: Add json_object(text[], json[])?  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Список pgsql-hackers
On Thu, Oct 24, 2019 at 8:45 AM Nikita Glukhov <n.gluhov@postgrespro.ru> wrote:
> You can simply use jsonb_object_agg() to build a jsonb object from a sequence
> of transformed key-value pairs:

<strikes forehead> I've even used that function before. :-) I tried
finding it on the JSON functions page but couldn't, so I thought maybe
I was going crazy. Of course it's on the aggregates page instead. As I
said it was late at night. :-) Your version works perfectly!

Even still, it may be nice to have a non-aggregate function that lets
you build nested JSON. But I agree jsonb_object_agg makes it less
needful.

Thanks!
Paul



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

Предыдущее
От: Paul A Jungwirth
Дата:
Сообщение: Re: Add json_object(text[], json[])?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: v12.0: ERROR: could not find pathkey item to sort