WITH query_1 as ( select a, a||'_francs', clock_timestamp() from generate_series(1,5000000) a ) insert into test_array(name) select array_agg(col1) from (select row_to_json(c) as col1 from query_1 c ) d ;
francs=> with query_1 as francs-> ( francs(> select a, a||'_francs', clock_timestamp() from generate_series(1,5000000) a francs(> ) francs-> insert into test_array(name) select array_agg(col1) from (select row_to_json(c) as col1 from query_1 c ) d ; INSERT 01
francs=> /dt+ test_array List of relations Schema | Name | Type | Owner | Size | Description --------+------------+-------+--------+-------+------------- francs | test_array | table | francs | 66 MB | (1 row)