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

From: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org, Joel Jacobson <joel(at)compiler(dot)org>
Subject: Re: [BUG FIX] Fix validation of COPY options FORCE_NOT_NULL/FORCE_NULL
Date: 2024-10-12 06:26:50
Message-ID: 5daef7fc-367a-4d8e-9b0f-d1df06aaed9a@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Zhang Mingli
www.hashdata.xyz
On Oct 12, 2024 at 07:48 +0800, Joel Jacobson <joel(at)compiler(dot)org>, wrote:
>
> Add missing checks for FORCE_NOT_NULL and FORCE_NULL when applied to
> all columns via "*". These options now correctly require CSV mode and
> are disallowed in COPY TO as appropriate.
Right.

we introduce FORCE_NOT_NULL/FORCE_NULL for all columns at commit f6d4c9c, but forget to check csv mode as force_notnull list does.
It could be possible user selects some columns,  then opts_out->force_notnull != NIL in this case.
Or user selects all columns, then  opts_out->force_notnull_all is true.
Both should be checked with csv mode.

Patch[2/2] make sense to me, thanks!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2024-10-12 06:52:50 Re: New "raw" COPY format
Previous Message Joel Jacobson 2024-10-12 05:44:39 Re: [BUG FIX] Fix validation of COPY options FORCE_NOT_NULL/FORCE_NULL