Re: [PATCH] Reject ENCODING option for COPY TO FORMAT JSON

From: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [PATCH] Reject ENCODING option for COPY TO FORMAT JSON
Date: 2026-05-04 14:43:41
Message-ID: CAJTYsWXy5u_EVHeKPM=_FfJutJ79xGPh4tYUMd4OowO4scmx9A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, 4 May 2026 at 19:49, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:

> Basically good, I think. I have modified your test a bit, testing more
> directly for the presence of the LATIN-1 encoded character and the absence
> of the UTF-8 encoded character, by reading in the file with
> pg_read_binary_file, and adding a test for implicit encoding by setting
> client_encoding.
>

The revised tests look better to me. Checking the raw bytes with
pg_read_binary_file() directly verifies that LATIN1 output does not contain
the UTF-8 sequence, and the added implicit client_encoding case too
looks good.

Thanks for improving the test coverage.

Regards,
Ayush

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-05-04 14:46:21 Re: [Bug][patch]: After dropping the last label from a property graph element, invoking pg_get_propgraphdef() triggers an assertion failure
Previous Message SATYANARAYANA NARLAPURAM 2026-05-04 14:26:34 Re: [Bug]Vacuum full silently NULL out fast default columns