Re: Emitting JSON to file using COPY TO

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Davin Shearer <scholarsmate(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Emitting JSON to file using COPY TO
Date: 2023-11-25 20:02:46
Message-ID: CAKFQuwbrNqsWcLrFcTurPOHtFQuCLWPk_6MLCrrVHhEp-wWJTw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Sat, Nov 25, 2023 at 12:22 PM Davin Shearer <scholarsmate(at)gmail(dot)com>
wrote:

>
> Is there a way to emit JSON results to file from within postgres?
>

Use psql to directly output query results to a file instead of using COPY
to output structured output in a format you don't want.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-11-25 21:00:12 Re: Emitting JSON to file using COPY TO
Previous Message Davin Shearer 2023-11-25 19:21:37 Emitting JSON to file using COPY TO

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2023-11-25 20:06:03 Re: brininsert optimization opportunity
Previous Message Alexander Lakhin 2023-11-25 20:00:01 Test 002_pg_upgrade fails with olddump on Windows