Re: [BUG FIX] Fix validation of COPY options FORCE_NOT_NULL/FORCE_NULL - Mailing list pgsql-hackers

From Zhang Mingli
Subject Re: [BUG FIX] Fix validation of COPY options FORCE_NOT_NULL/FORCE_NULL
Date
Msg-id 5daef7fc-367a-4d8e-9b0f-d1df06aaed9a@Spark
Whole thread Raw
List pgsql-hackers
Hi, 


Zhang Mingli
www.hashdata.xyz
On Oct 12, 2024 at 07:48 +0800, Joel Jacobson <joel@compiler.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!

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: New "raw" COPY format
Next
From: jian he
Date:
Subject: Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)