Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sOgyX-000buE-HF for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Jul 2024 17:07:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sOgyU-0032yp-T9 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Jul 2024 17:07:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sOgyU-0032yg-Jb for pgsql-hackers@lists.postgresql.org; Tue, 02 Jul 2024 17:07:27 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sOgyR-0005Jr-VA for pgsql-hackers@lists.postgresql.org; Tue, 02 Jul 2024 17:07:25 +0000 Received: from [192.168.11.8] (p4447245-ipxg14001funabasi.chiba.ocn.ne.jp [153.195.220.245]) by oss.nttdata.com (Postfix) with ESMTPSA id 7C4D56187B for ; Wed, 3 Jul 2024 02:07:17 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: Date: Wed, 3 Jul 2024 02:07:16 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add new COPY option REJECT_LIMIT To: pgsql-hackers@lists.postgresql.org References: <63f99327aa6b404cc951217fa3e61fe4@oss.nttdata.com> Content-Language: en-US From: Fujii Masao In-Reply-To: <63f99327aa6b404cc951217fa3e61fe4@oss.nttdata.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024/01/26 18:49, torikoshia wrote: > Hi, > > 9e2d870 enabled the COPY command to skip soft error, and I think we can add another option which specifies the maximum tolerable number of soft errors. > > I remember this was discussed in [1], and feel it would be useful when loading 'dirty' data but there is a limit to how dirty it can be. > > Attached a patch for this. > > What do you think? The patch no longer applies cleanly to HEAD. Could you update it? I think the REJECT_LIMIT feature is useful. Allowing it to be set as either the absolute number of skipped rows or a percentage of the total input rows is a good idea. However, if we support REJECT_LIMIT, I'm not sure if the ON_ERROR option is still necessary. REJECT_LIMIT seems to cover the same cases. For instance, REJECT_LIMIT=infinity can act like ON_ERROR=ignore, and REJECT_LIMIT=0 can act like ON_ERROR=stop. Therefore, having both ON_ERROR and REJECT_LIMIT might be confusing. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION