Re: Add new COPY option REJECT_LIMIT

From: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, zhjwpku(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add new COPY option REJECT_LIMIT
Date: 2024-07-23 14:10:24
Message-ID: e2849c17dabaac61a6a628a2cc60f4ab@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024-07-23 02:06, Kirill Reshke wrote:

Thanks for your review.

> Few comments:
>
>> + When a positive integer value is specified,
>> <command>COPY</command> limits
>> + the maximum tolerable number of errors while converting a
>> column's input
>> + value into its data type.
>
> If nothing is specified, then the maximum tolerable number of errors
> is one, right? Should we state this explicitly in the documentation?

REJECT_LIMIT now can be used wonly when on_error=ignore, I think the
default(when only on_error=ignore is specified) is unlimited.
Anyway, I'm going to add a description about the default.

>> +COPY x from stdin with (on_error ignore, reject_limit 0);
> How about a test where reject_limit is a string, but not
> (case-intensively) 'infinity'?

Considering the discussion in[1], I'm now going to remove 'infinity'.

>> + CopyRejectLimits reject_limits; /* thresholds of reject_limit */
>
> Why are there multiple thresholds? Can we have only one?

This is because I thought it'd be more convenient to support both the
number and the ratio of error, but I'm also beginning to think that it
might be better to support only the number of cases, as discussed in
[1].

[1]https://www.postgresql.org/message-id/5f807fcf3a36df7ba41464ab40b5c37d%40oss.nttdata.com

--
Regards,

--
Atsushi Torikoshi
NTT DATA Group Corporation

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2024-07-23 14:23:53 Re: PG_TEST_EXTRA and meson
Previous Message torikoshia 2024-07-23 14:06:32 Re: Add new COPY option REJECT_LIMIT