Re: json function question

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: json function question
Дата
Msg-id 56CDBEA2.3030100@dunslane.net
обсуждение исходный текст
Ответ на Re: json function question  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: json function question  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general

On 02/24/2016 09:11 AM, David G. Johnston wrote:
> On Wednesday, February 24, 2016, Andrew Dunstan <andrew@dunslane.net
> <mailto:andrew@dunslane.net>> wrote:
>
>
>     Having json(b)_populate_record recursively process nested complex
>     objects would be a large undertaking. One thing to consider is
>     that json arrays are quite different from Postgres arrays: they
>     are essentially one-dimensional heterogenous lists, not
>     multi-dimensional homogeneous matrices. So while a Postgres array
>     that's been converted to a json array should in principle be
>     convertible back, an arbitrary json array could easily not be.
>
>
> An arbitrary json array should be one-dimensional and homogeneous -
> seems like that should be easy to import.  The true concern is that
> not all PostgreSQL arrays are capable of being represented in json.



Neither of these things are true AFAIK.

1. The following is a 100% legal json array, about as heterogenous as
can be:

    [ "a" , 1, true, null, [2,false], {"b": null} ]


2. Having implemented the routines to convert Postgres arrays to json
I'm not aware of any which can't be converted. Please supply an example
of one that can't.


cheers

andrew




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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: json function question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: json function question