From: | Filip Sedlák <filip(at)sedlakovi(dot)org> |
---|---|
To: | Dominique Devienne <ddevienne(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Davin Shearer <scholarsmate(at)gmail(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Emitting JSON to file using COPY TO |
Date: | 2023-11-28 07:36:32 |
Message-ID: | 3a98decf-3fe3-4b49-9b68-fda01338872c@sedlakovi.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Kyotaro Horiguchi | 2023-11-28 08:54:43 | Re: Could not read from file "pg_subtrans/00F5" at offset 122880: Success. |
Previous Message | Adrian Klaver | 2023-11-28 05:38:52 | Re: Installing extension temporal_tables for PG13 |
From | Date | Subject | |
---|---|---|---|
Next Message | Bharath Rupireddy | 2023-11-28 08:02:41 | Re: [PoC] pg_upgrade: allow to upgrade publisher node |
Previous Message | Laurenz Albe | 2023-11-28 07:05:02 | Re: GUC names in messages |