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 1rUN0u-00ASwl-SH for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 08:29:09 +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 1rUN0s-00CZzf-V1 for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 08:29:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rUN0s-00CZzV-Ln for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 08:29:06 +0000 Received: from ml.sraoss.co.jp ([66.11.59.17]) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rUN0o-003w2M-80 for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 08:29:04 +0000 Received: from sranhm.sraoss.co.jp (unknown [192.168.174.164]) by osspc26.sraoss.co.jp (Postfix) with ESMTP id CA3C72F00094; Mon, 29 Jan 2024 17:28:59 +0900 (JST) Received: from yugon-CFSV7-1 (unknown [192.168.176.11]) by sranhm.sraoss.co.jp (Postfix) with SMTP id 717B93418C0; Mon, 29 Jan 2024 17:28:59 +0900 (JST) Date: Mon, 29 Jan 2024 17:28:58 +0900 From: Yugo NAGATA To: "David G. Johnston" Cc: PostgreSQL Hackers Subject: Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row Message-Id: <20240129172858.ccb6c77c3be95a295e2b2b44@sraoss.co.jp> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 26 Jan 2024 08:08:29 -0700 "David G. Johnston" wrote: > Hi, > > The option choice of "ignore" in the COPY ON_ERROR clause seems overly > generic. There would seem to be two relevant ways to ignore bad column > input data - drop the entire row or just set the column value to null. I > can see us wanting to provide the set to null option and in any case having > the option name be explicit that it ignores the row seems like a good idea. I am not in favour of renaming the option name "ignore", instead we can use another style of name for the option to set the column value to NULL, for example, "set_to_null". (Maybe, we can make a more generic option "set_to (col, val)" that can set the value of column specified by "col" value to the specified value "val" (e.g. 'N/A') on a soft error, although the syntax would be a bit complex...) IMO, it is more simple to define "ignore" as to skip the entire row rather than having variety of "ignore". Once defined it so, the option to set the column value to NULL should not be called "ignore" because values in other columns will be inserted. Regards, Yugo Nagata > > David J. -- Yugo NAGATA