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

Поиск
Список
Период
Сортировка
От Greg Hazel
Тема Re: BUG #7620: array_to_json doesn't support heterogeneous arrays
Дата
Msg-id E54F8153-EA35-4AF1-AB36-FEA63EA18A75@gmail.com
обсуждение исходный текст
Ответ на Re: BUG #7620: array_to_json doesn't support heterogeneous arrays  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-bugs
On Oct 23, 2012, at 6:03 PM, Merlin Moncure <mmoncure@gmail.com> wrote:

> On Tue, Oct 23, 2012 at 6:32 PM,  <ghazel@gmail.com> wrote:
>> The following bug has been logged on the website:
>>=20
>> Bug reference:      7620
>> Logged by:          Greg Hazel
>> Email address:      ghazel@gmail.com
>> PostgreSQL version: 9.2.1
>> Operating system:   Amazon Linux
>> Description:
>>=20
>> array_to_json(ARRAY['foo', 100, true]) complains because arrays can't =
have
>> mixed types, but json arrays can.
>>=20
>> So, it's not possible to form a heterogeneous json array, when this =
is often
>> desired.
>=20
> This is not really a bug because the feature is working as intended.
> Postgres arrays are homogonous so what you're asking really isn't
> possible.  You can though use row_to_json to work around:
>=20
> select row_to_json(row('foo', 100, true));

That doesn't produce the same results.

Call it a feature request or a bug report, the postgres json support =
fails to make the json I need.

-Greg

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Introducing floating point cast into filter drastically changes row estimate
Следующее
От: Greg Hazel
Дата:
Сообщение: Re: BUG #7620: array_to_json doesn't support heterogeneous arrays