SELECT json_agg(f) As cats FROM( SELECT tablename FROM pg_tables ) As f;
json_agg需要postgresql 9.4.x或者以上版本