Re: Emitting JSON to file using COPY TO

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Davin Shearer <davin(at)apache(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Emitting JSON to file using COPY TO
Date: 2024-01-08 19:36:34
Message-ID: CAEZATCWh29787xf=4NgkoixeqRHrqi0Qd33Z6_-F8t2dZ0yLCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, 7 Dec 2023 at 01:10, Joe Conway <mail(at)joeconway(dot)com> wrote:
>
> The attached should fix the CopyOut response to say one column.
>

Playing around with this, I found a couple of cases that generate an error:

COPY (SELECT 1 UNION ALL SELECT 2) TO stdout WITH (format json);

COPY (VALUES (1), (2)) TO stdout WITH (format json);

both of those generate the following:

ERROR: record type has not been registered

Regards,
Dean

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2024-01-08 20:40:23 Re: Emitting JSON to file using COPY TO
Previous Message Tom Lane 2024-01-08 17:12:42 Re: How to \ef a function ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-01-08 19:57:34 Re: the s_lock_stuck on perform_spin_delay
Previous Message Paul Jungwirth 2024-01-08 18:54:13 Re: SQL:2011 application time