Re: [BUG FIX] Fix validation of COPY options FORCE_NOT_NULL/FORCE_NULL

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [BUG FIX] Fix validation of COPY options FORCE_NOT_NULL/FORCE_NULL
Date: 2024-10-17 22:52:59
Message-ID: ZxGVS4KuVMUPFAld@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 17, 2024 at 10:21:54AM +0200, Joel Jacobson wrote:
> I believe the correction should be to use COPY TO stdout instead of
> COPY FROM stdin, since FORCE_QUOTE is only applicable with COPY TO.
> This way, the test correctly verifies the disallowed combination of FORCE_QUOTE
> with a non-CSV format in COPY TO.
>
> I see how this is easy to miss, since the tests for the three FORCE_* options
> look very similar, but they are different in that it's only FORCE_QUOTE that
> is allowed for COPY TO, whereas the two other FORCE_NOT_NULL
> and FORCE_NULL are only allowed for COPY FROM.

This one is intentional. I was looking at the full picture of these
queries yesterday, and decided to maximize the number of COPY FROM for
all the queries that do not check option interactions that rely on TO
or FROM to exist. Hence, the tests are now shaped so as COPY TO is
only used where we expect it to be set, while the sequence is lossy
only with COPY FROM.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-10-17 23:08:55 Re: Large expressions in indexes can't be stored (non-TOASTable)
Previous Message Michael Paquier 2024-10-17 22:44:08 Add isolation test template in injection_points for wait/wakeup/detach