Re: Add on_error and log_verbosity options to file_fdw

From: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, sawada(dot)mshk(at)gmail(dot)com, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add on_error and log_verbosity options to file_fdw
Date: 2024-09-26 12:57:34
Message-ID: 6383a9a5b90a36dbe60c6f30286d2254@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024-09-25 00:46, Fujii Masao wrote:
Thanks for the comments!

> On 2024/09/24 20:08, torikoshia wrote:
>> Thanks for the explanation and suggestion.
>> Since there is almost the same code in copyfrom.c, attached 0003 patch
>> for refactoring both.
>
> Thanks for updating the patches!
>
> Regarding 0002.patch, I think it’s better to include the refactored
> code
> from the start rather than adding redundant code intentionally.
> How about leaving just the refactor in copyfrom.c to 0003.patch?
> If that works, as a refactoring, you could also replace "skipped" with
> "cstate->num_errors" in that patch, as you suggested earlier.

Agreed.

> While reviewing again, I noticed that running ANALYZE on a file_fdw
> foreign table also calls NextCopyFrom(), but it doesn’t seem to
> skip erroneous rows when on_error is set to "ignore." This could lead
> to inaccurate statistics. Shouldn’t ANALYZE on file_fdw foreign tables
> with on_error=ignore also skip erroneous rows?

Thanks, it seems the right thing to do.

>>> The tab-completion needs to be updated to support the "silent"
>>> option?
>>
>> Yes, updated 0002 patch.
>
> Thanks! Also, this should be part of 0001.patch since "silent" is
> introduced there, right?

Agreed.

Updated the patches.

--
Regards,

--
Atsushi Torikoshi
NTT DATA Group Corporation

Attachment Content-Type Size
v5-0001-Add-log_verbosity-to-silent.patch text/x-diff 6.3 KB
v5-0002-Add-on_error-and-log_verbosity-options-to-file_fd.patch text/x-diff 7.6 KB
v5-0003-Refactor-copyfrom.c.patch text/x-diff 2.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Florents Tselai 2024-09-26 12:59:51 Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part
Previous Message jian he 2024-09-26 12:19:46 Re: not null constraints, again