Re: BUG #7620: array_to_json doesn't support heterogeneous arrays
В списке pgsql-bugs по дате отправления:
| От | Craig Ringer |
|---|---|
| Тема | Re: BUG #7620: array_to_json doesn't support heterogeneous arrays |
| Дата | |
| Msg-id | 508CDF2E.7060305@ringerc.id.au обсуждение исходный текст |
| Ответ на | Re: BUG #7620: array_to_json doesn't support heterogeneous arrays (Greg Hazel <ghazel@gmail.com>) |
| Список | pgsql-bugs |
On 10/24/2012 11:46 PM, Greg Hazel wrote:
> Another option that just occurred to me is a new function (say, to_json) that converts the parameter to its json
representation,with type json.
>
> Then this would be possible:
>
> select array_to_json(ARRAY[to_json('foo'), to_json(100), to_json(true)]);
That's been repeatedly discussed (and requested, and had patches posted)
on -hackers. Right now the standing opinion appears to be that "json"
represents a whole json document, and json documents must be arrays or
JavaScript objects, not scalars, so it is not valid to provide a scalar
"to_json".
I posted patches to support this functionality - as did several others
as it turns out - and they've all been rejected.
--
Craig Ringer
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера