Re:Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

Yi Ding <dingyi_yale@163.com>

From: "Yi Ding" <dingyi_yale@163.com>
To: "Fujii Masao" <masao.fujii@gmail.com>
Cc: "Peter Eisentraut" <peter@eisentraut.org>, "jian he" <jian.universality@gmail.com>, "Matheus Alcantara" <matheusssilv97@gmail.com>, torikoshia <torikoshia@oss.nttdata.com>, "Masahiko Sawada" <sawada.mshk@gmail.com>, "vignesh C" <vignesh21@gmail.com>, "Jim Jones" <jim.jones@uni-muenster.de>, "Kirill Reshke" <reshkekirill@gmail.com>, "Fujii Masao" <masao.fujii@oss.nttdata.com>, "David G. Johnston" <david.g.johnston@gmail.com>, "Yugo NAGATA" <nagata@sraoss.co.jp>, "PostgreSQL Hackers" <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-13T05:51:25Z
Lists: pgsql-hackers












At 2026-03-13 10:57:13, "Fujii Masao" <masao.fujii@gmail.com> wrote:
>On Wed, Mar 4, 2026 at 10:25 PM Fujii Masao <masao.fujii@gmail.com> wrote:
>>
>> On Tue, Mar 3, 2026 at 3:38 PM Peter Eisentraut <peter@eisentraut.org> wrote:
>> > Thanks, committed.
>>
>> Thanks for committing the patch!
>>
>> With this change, ON_ERROR = 'set_null' can now be used with foreign tables
>> backed by file_fdw. However, unlike ON_ERROR = 'ignore', there is currently
>> no regression test covering this behavior in file_fdw.
>>
>> How about adding a regression test to ensure that file_fdw works correctly
>> with ON_ERROR = 'set_null', and to improve test coverage? Patch attached.
>
>Barring any objections, I will commit the patch.
>
>Regards,
>
>-- 
>Fujii Masao

>


The new test added in v1 makes sense to me. A small suggestion is that to verify if a field is really null, we can do:

ALTER FOREIGN TABLE agg_bad OPTIONS (ADD on_error 'set_null');
SELECT a, b IS NULL FROM agg_bad;


Regards,
Ding Yi

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. file_fdw: Add regression test for file_fdw with ON_ERROR='set_null'

  2. Add COPY (on_error set_null) option

  3. Add REJECT_LIMIT option to the COPY command.

  4. Add log_verbosity = 'silent' support to COPY command.

  5. Add new COPY option LOG_VERBOSITY.