Search Postgresql Archives

Re: Emitting JSON to file using COPY TO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This would be a very special case for COPY. It applies only to a single column of JSON values. The original problem can be solved with psql --tuples-only as David wrote earlier.


$ psql -tc 'select json_agg(row_to_json(t))
             from (select * from public.tbl_json_test) t;'

 [{"id":1,"t_test":"here's a \"string\""}]


Special-casing any encoding/escaping scheme leads to bugs and harder parsing.

Just my 2c.

--
Filip Sedlák





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux