Re: BUG #7620: array_to_json doesn't support heterogeneous arrays

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Владимир Сошенко
Дата:
Сообщение: Installation issue
Следующее
От: tixu@cs.ucsd.edu
Дата:
Сообщение: BUG #7624: Misleading Log Message & Inconsistent Configuration Design