The following bug has been logged on the website:
Bug reference: 10728
Logged by: Matti Hameister
Email address: matti.hameister@technologygroup.de
PostgreSQL version: 9.4beta1
Operating system: Linux
Description:
This query:
--
SELECT X.* FROM
json_to_record(
'
{"a":2,"c":3,"b":{"z":4}, "d":6}
',true
) AS X(a int, b json, c int, d int);
--
returns as expected
a: 2
b: {"z":4}
c: 3
d: 6
Now I changed the query a bit (using recordset):
--
SELECT X.* FROM
json_to_recordset(
'[
{"a":2,"c":3,"b":{"z":4}, "d":6}
]
',true
) AS X(a int, b json, c int, d int);
--
the result is surprising:
a: NULL
b: {"z":4}
c: NULL
d: 6