]> granicus.if.org Git - postgresql/commit
Make json_populate_record and friends operate recursively
authorAndrew Dunstan <andrew@dunslane.net>
Fri, 7 Apr 2017 02:11:21 +0000 (22:11 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 7 Apr 2017 02:22:13 +0000 (22:22 -0400)
commitcf35346e813e5a1373f308d397bb0a8f3f21d530
tree8eb3d30d8218ae21aef5c146d4e6a04a6d52004a
parent510074f9f0131a04322d6a3d2a51c87e6db243f9
Make json_populate_record and friends operate recursively

With this change array fields are populated from json(b) arrays, and
composite fields are populated from json(b) objects.

Along the way, some significant code refactoring is done to remove
redundancy in the way to populate_record[_set] and to_record[_set]
functions operate, and some significant efficiency gains are made by
caching tuple descriptors.

Nikita Glukhov, edited some by me.

Reviewed by Aleksander Alekseev and Tom Lane.
doc/src/sgml/func.sgml
src/backend/utils/adt/jsonfuncs.c
src/test/regress/expected/json.out
src/test/regress/expected/jsonb.out
src/test/regress/sql/json.sql
src/test/regress/sql/jsonb.sql