Re: a bug jsonb?

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: a bug jsonb?
Дата
Msg-id CA+bJJbxQjAHqsUyWswUwJ65O4kRvam3jqCiN33RW77+g+y8Xxg@mail.gmail.com
обсуждение исходный текст
Ответ на a bug jsonb?  (Станислав Губанов <gubanovss@gmail.com>)
Список pgsql-general
On Thu, Nov 22, 2018 at 3:59 PM Станислав Губанов <gubanovss@gmail.com> wrote:
....
> order of key in json is changed in such query:
> SELECT json_data FROM test_json;
> expected result: {"rootC":{},"rootB":{},"rootZ":{},"rootA":[]}
> actual result: {"rootA": [], "rootB": {}, "rootC": {}, "rootZ": {}}

From https://www.postgresql.org/docs/11/datatype-json.html

"There are two JSON data types: json and jsonb. They accept almost
identical sets of values as input. The major practical difference is
one of efficiency. The json data type stores an exact copy of the
input text, which processing functions must reparse on each execution;
while jsonb data is stored in a decomposed binary format that makes it
slightly slower to input due to added conversion overhead, but
significantly faster to process, since no reparsing is needed. jsonb
also supports indexing, which can be a significant advantage.

Because the json type stores an exact copy of the input text, it will
preserve semantically-insignificant white space between tokens, as
well as the order of keys within JSON objects. Also, if a JSON object
within the value contains the same key more than once, all the
key/value pairs are kept. (The processing functions consider the last
value as the operative one.) By contrast, jsonb does not preserve
white space, does not preserve the order of object keys, and does not
keep duplicate object keys. If duplicate keys are specified in the
input, only the last value is kept."

Francisco Olarte.


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

Предыдущее
От: Josef Šimánek
Дата:
Сообщение: Re: a bug jsonb?
Следующее
От: Ádám Maracska
Дата:
Сообщение: Compile postgresql libraries with VS17