[HACKERS] PATCH: recursive json_populate_record()

Поиск
Список
Период
Сортировка
От Nikita Glukhov
Тема [HACKERS] PATCH: recursive json_populate_record()
Дата
Msg-id 222c7cfb-73c8-a56e-7844-3dc51682760d@postgrespro.ru
обсуждение исходный текст
Ответы Re: [HACKERS] PATCH: recursive json_populate_record()  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Hi.

The first attached patch implements recursive processing of nested 
objects and arrays in json[b]_populate_record[set](), 
json[b]_to_record[set](). See regression tests for examples.

It also fixes the following errors/inconsistencies caused by lost 
quoting of string json values:

[master]=# select * from json_to_record('{"js": "a"}') as rec(js json);
ERROR:  invalid input syntax for type json
DETAIL:  Token "a" is invalid.
CONTEXT:  JSON data, line 1: a

[master]=# select * from json_to_record('{"js": "true"}') as rec(js json);
   js
------
true

[patched]=# select * from json_to_record('{"js": "a"}') as rec(js json);
   js
-----
  "a"

[patched]=# select * from json_to_record('{"js": "true"}') as rec(js json);
    js
--------
  "true"


The second patch adds assignment of correct ndims to array fields of 
RECORD function result types.
Without this patch, attndims in tuple descriptors of RECORD types is 
always 0 and the corresponding assertion fails in the next test:

[patched]=# select json_to_record('{"a": [1, 2, 3]}') as rec(a int[]);


Should I submit these patches to commitfest?

-- 
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] Logical Replication WIP
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: [HACKERS] PATCH: two slab-like memory allocators