Database Reference
In-Depth Information
insert into test3(data3)
select array(select test2 from test2);
Let's see if row_to_json still works:
select row_to_json(t3, true) from test3 t3;
------------------------------------------
{"id":1,
"data3":[ {"id":1,
"data2":{"id":1,
"data":"0.262814193032682",
"tstamp":"2012-04-05
13:21:03.235204"},
"tstamp":"2012-04-05
13:25:03.644497"
},
{"id":2,
"data2":{"id":2,
"data":"0.157406373415142",
"tstamp":"2012-04-05
13:21:05.2033"},
"tstamp":"2012-04-05
13:25:03.644497"
}
],
"tstamp":"2012-04-16 14:40:15.795947"}
(1 row)
Yes it does!
Well, actually I had to manually format it a little, as the prettyprint flag to
row_to_json() only forks for top level, and the second row of the result (the one
following "data3" ) was all on one line. But JSON itself was completely functional!
Search WWH ::




Custom Search