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

Поиск
Список
Период
Сортировка
От Paul A Jungwirth
Тема Re: Add json_object(text[], json[])?
Дата
Msg-id CA+renyU3LHWw8NW40nzcB=i4KVRqrjPoJVdB7Rvi-z839wCo-g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add json_object(text[], json[])?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Add json_object(text[], json[])?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Oct 24, 2019 at 8:52 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I think a potential problem is creation of ambiguity where there was
> none before.

I agree that's not nice, and it seems like a new name might be better.

> Also, as the prototype implementation shows, it's not like you
> can't get this functionality today ... you just need to cast
> jsonb to text.  Admittedly that's annoying and wasteful.

I don't think that gives the same result, does it? For example:

# select jsonb_object(array['foo'], array['[{"bar-bar": ["baz"]}]'::jsonb]);
             jsonb_object
---------------------------------------
 {"foo": "[{\"bar-bar\": [\"baz\"]}]"}

You can see the values are JSON strings, not JSON arrays/objects/etc.

Regards,
Paul



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

Предыдущее
От: Victor Spirin
Дата:
Сообщение: psql tab-complete
Следующее
От: Paul A Jungwirth
Дата:
Сообщение: Re: Add json_object(text[], json[])?