Re: Emitting JSON to file using COPY TO

2023-11-29 Thread Davin Shearer
Thanks for the responses everyone. I worked around the issue using the `psql -tc` method as Filip described. I think it would be great to support writing JSON using COPY TO at some point so I can emit JSON to files using a PostgreSQL function directly. -Davin On Tue, Nov 28, 2023 at 2:36 AM Fil

Emitting JSON to file using COPY TO

2023-11-25 Thread Davin Shearer
Hello! I'm trying to emit a JSON aggregation of JSON rows to a file using COPY TO, but I'm running into problems with COPY TO double quoting the output. Here is a minimal example that demonstrates the problem I'm having: create table public.tbl_json_test (id int, t_test text); -- insert text tha