generator for pg2json