Re: Emitting JSON to file using COPY TO

From: Davin Shearer <davin(at)apache(dot)org>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: Emitting JSON to file using COPY TO
Date: 2023-12-04 01:27:49
Message-ID: CALvfUkDmDQNkXxP6Ci9z5KmD3FnR0H0zaC4-M6UN2tuedNT76g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

I worked around it by using select json_agg(t)... and redirecting it to
file via psql on the command line. COPY TO was working until we ran into
broken JSON and discovered the double quoting issue due to some values
containing " in them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message senor 2023-12-04 02:08:03 vacuum visibility relevance
Previous Message Joe Conway 2023-12-04 01:14:31 Re: Emitting JSON to file using COPY TO

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2023-12-04 01:29:13 Use PGAlignedBlock instead of "char buf[BLCKSZ]" in more places
Previous Message Michael Paquier 2023-12-04 01:14:36 Re: Is WAL_DEBUG related code still relevant today?