BUG #10728: json_to_recordset with nested json objects NULLs columns - Mailing list pgsql-bugs

From matti.hameister@technologygroup.de
Subject BUG #10728: json_to_recordset with nested json objects NULLs columns
Date
Msg-id 20140622153409.2618.90346@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #10728: json_to_recordset with nested json objects NULLs columns
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: "MauMau"
Date:
Subject: Re: Missing file versions for a bunch of dll/exe files in Windows builds
Next
From: Michael Paquier
Date:
Subject: Re: BUG #10728: json_to_recordset with nested json objects NULLs columns