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 1rX9Ue-0092d5-36 for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Feb 2024 00:39:20 +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 1rX9Ud-00Gn7Y-7E for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Feb 2024 00:39:19 +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 1rX9Uc-00Gn7Q-Tu for pgsql-hackers@lists.postgresql.org; Tue, 06 Feb 2024 00:39:18 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rX9UZ-005fQS-Mk for pgsql-hackers@lists.postgresql.org; Tue, 06 Feb 2024 00:39:17 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1d93ddd76adso2212805ad.2 for ; Mon, 05 Feb 2024 16:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707179953; x=1707784753; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=qySIQ5q4AOmyNWKwzDF7cPxWZovaxwrWYukhtfjrjp8=; b=ergOn7RWFcya2c3MKvFxxr+DgJnL2ETF1/L+WCQyXdXd1K4CD24FDLih19PCEk7SPn K30n5/p9O85BOZOljAjmXtMjKZPo0BMzOp363NzyEzaOIbpuNCA/3YH7q4BlVjUkhUvp DJECC054B4oM5Kix9vatjoLIW1wMTG9o+pCvgmZPdvnR+fDeSHizkNaA+4sP1ToObCRp SnhCmGTDOi+aYItgLXFD/VRUklRziBW4ypGpCCkUfFoCJdjLVGXixVDVlA9ON9HpReJk kDFMCzAtgT1DjKJ9TGo8CR6T7vpHqllg9P9prOvguI58w3t8NgkpbruDpWXG3MoUK6yZ oCaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707179953; x=1707784753; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qySIQ5q4AOmyNWKwzDF7cPxWZovaxwrWYukhtfjrjp8=; b=PYw3Eaxn9AbAYbmVFwtQveWvNS/jTHyyB8uPk46kpCx8GrdKtCHvSH60txh3+8F+ON UF3VjbfiByCMZlB2fJIaRKCm4BZXH5HtY0wfX2xqhwmJQ8hQrqqdQnbElIUKuIHYaLfh JoTlkZ4LmlJq2Ts6Dv0eCOVM0ZKYr017blnn+SC6Ix1deMAzeT49UTC1fTEHd7w/lBjj pQsWKfuNLlkuglUZt5dTCQQ2Z4DjGfyR5fKXzQBod9hqtxB4spVkNqEmlb0Mh4uBvnuI nd5wW5jRLqcbnWjuvblMQwmEI74kPG5IfiNZZqb6uHlTgruEBw8hk/KDEjPiUi+vhRJm M+5g== X-Gm-Message-State: AOJu0Yx6dSubM7aKoZ1sextInOxnIea5ch9akNoNXWrZZBfsto5fSu2o kxzmM5ttn0GYrSQF946MZYU6BnnCVGMmZ3wa18RfxV76IPnrPkQY X-Google-Smtp-Source: AGHT+IGdvJAhfF+OXQx77Jv11hpxd8xDVyUVM89bJRQo4QjYmDd0e4IB4VIz28MFgPxTUMEt2vQyhA== X-Received: by 2002:a17:903:2304:b0:1d8:fb03:a01e with SMTP id d4-20020a170903230400b001d8fb03a01emr172372plh.32.1707179952947; Mon, 05 Feb 2024 16:39:12 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUrHAV17PvyIHA31fQEMeKlSkzygJX60IJkZUCqWJeknE0aUTtXyt6KjYkeoa8eM9pPexlITztE34xlJHSg6WNe041BV9IyhPXAqqxFleUlQNwd2QDsg1DIsVu+l3wetNKq73DyMxSmCaWXkMeBiAcSofK2J41ly+Yt/iQdCp7bdbHMlqGk+AFpTG2vNRzQJ/LIfmZ7hblJTbx5o/jYPihwOtV+Zg== Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id jy3-20020a17090342c300b001d95b3c6259sm485085plb.263.2024.02.05.16.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 16:39:12 -0800 (PST) Date: Tue, 06 Feb 2024 09:39:09 +0900 (JST) Message-Id: <20240206.093909.1866377550429411676.horikyota.ntt@gmail.com> To: nagata@sraoss.co.jp Cc: torikoshia@oss.nttdata.com, jian.universality@gmail.com, david.g.johnston@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row From: Kyotaro Horiguchi In-Reply-To: <20240205172256.0942c4e8b757fc6f7c4dbfa8@sraoss.co.jp> References: <04bf425ad1b15a4daefe96c478a5253b@oss.nttdata.com> <20240205172256.0942c4e8b757fc6f7c4dbfa8@sraoss.co.jp> User-Agent: Mew version 6.8 on Emacs 27.2 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 At Mon, 5 Feb 2024 17:22:56 +0900, Yugo NAGATA wrote in > On Mon, 05 Feb 2024 11:28:59 +0900 > torikoshia wrote: > > > > Based on this, I've made a patch. > > > based on COPY Synopsis: ON_ERROR 'error_action' > > > on_error 'null', the keyword NULL should be single quoted. > > > > As you mentioned, single quotation seems a little odd.. > > > > I'm not sure what is the best name and syntax for this feature, but > > since current error_action are verbs('stop' and 'ignore'), I feel 'null' > > might not be appropriate. > > I am not in favour of using 'null' either, so I suggested to use > "set_to_null" or more generic syntax like "set_to (col, val)" in my > previous post[1], although I'm not convinced what is the best either. > > [1] https://www.postgresql.org/message-id/20240129172858.ccb6c77c3be95a295e2b2b44%40sraoss.co.jp Tom sugggested using a separate option, and I agree with the suggestion. Taking this into consideration, I imagined something like the following, for example. Although I'm not sure we are actually going to do whole-tuple replacement, the action name in this example has the suffix '-column'. COPY (on_error 'replace-colomn', replacement 'null') .. regards. -- Kyotaro Horiguchi NTT Open Source Software Center