Re: Emitting JSON to file using COPY TO

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, 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>, Junwang Zhao <zhjwpku(at)gmail(dot)com>
Subject: Re: Emitting JSON to file using COPY TO
Date: 2024-02-02 10:05:53
Message-ID: CACJufxGaoEncsv4pb+JhZLnWJ=Z4j1HQqzLV0rtiYDFFgKKx=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, Feb 2, 2024 at 5:48 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>
> If you want the server to send this message when the JSON word is not in
> quotes, I'm afraid that's not possible, due to the funny nature of the
> FORMAT keyword when the JSON keyword appears after it. But why do you
> care? If you use the patch, then you no longer need to have the "not
> recognized" error messages anymore, because the JSON format is indeed
> a recognized one.
>

"JSON word is not in quotes" is my intention.

Now it seems when people implement any custom format for COPY,
if the format_name is a keyword then we need single quotes.

Thanks for clarifying!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Sabino Mullane 2024-02-02 18:36:39 Re: vacuum freeze wait_event BufferPin
Previous Message Alvaro Herrera 2024-02-02 09:47:59 Re: Emitting JSON to file using COPY TO

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-02-02 10:15:13 Re: Synchronizing slots from primary to standby
Previous Message Alvaro Herrera 2024-02-02 09:47:59 Re: Emitting JSON to file using COPY TO