2017-02-16 56 views

回答

0
select format('{%s}',string_agg(format('"%s": %s', id, info), ','))::jsonb 
from t 
; 
       format    
------------------------------------ 
{"1": {"i": 123}, "2": {"i": 456}}