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 1rQDbx-00HLW2-SX for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jan 2024 21:38:14 +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 1rQDbw-00G35A-GZ for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jan 2024 21:38:12 +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 1rQDbw-00G352-2T for pgsql-hackers@lists.postgresql.org; Wed, 17 Jan 2024 21:38:12 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rQDbt-00235E-K9 for pgsql-hackers@lists.postgresql.org; Wed, 17 Jan 2024 21:38:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 40HLbvIZ2070916; Wed, 17 Jan 2024 16:37:58 -0500 From: Tom Lane To: Alexander Korotkov cc: Kyotaro Horiguchi , torikoshia@oss.nttdata.com, sawada.mshk@gmail.com, jian.universality@gmail.com, vignesh21@gmail.com, lena.ribackina@yandex.ru, dam.bel07@gmail.com, zhihuifan1213@163.com, daniel@yesql.se, pgsql-hackers@postgresql.org, andres@anarazel.de, anisimow.d@gmail.com, HukuToc@gmail.com, pgsql-hackers@lists.postgresql.org, a.lepikhov@postgrespro.ru Subject: Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features) In-reply-to: References: <762d7dd4d5aa9e5ecffec2ae6a255a28@oss.nttdata.com> <20240117.164859.2242646601795501168.horikyota.ntt@gmail.com> Comments: In-reply-to Alexander Korotkov message dated "Wed, 17 Jan 2024 23:06:56 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2070914.1705527477.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 17 Jan 2024 16:37:57 -0500 Message-ID: <2070915.1705527477@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Korotkov writes: > On Wed, Jan 17, 2024 at 9:49 AM Kyotaro Horiguchi > wrote: >> On the other hand, SAVE_ERROR_TO takes 'error' or 'none', which >> indicate "immediately error out" and 'just ignore the failure' >> respectively, but these options hardly seem to denote a 'location', >> and appear more like an 'action'. I somewhat suspect that this >> parameter name intially conceived with the assupmtion that it would >> take file names or similar parameters. I'm not sure if others will >> agree, but I think the parameter name might not be the best >> choice. For instance, considering the addition of the third value >> 'log', something like on_error_action (error, ignore, log) would be >> more intuitively understandable. What do you think? > Probably, but I'm not sure about that. The name SAVE_ERROR_TO assumes > the next word will be location, not action. With some stretch we can > assume 'error' to be location. I think it would be even more stretchy > to think that SAVE_ERROR_TO is followed by action. The other problem with this terminology is that with 'none', what it is doing is the exact opposite of "saving" the errors. I agree we need a better name. Kyotaro-san's suggestion isn't bad, though I might shorten it to error_action {error|ignore|log} (or perhaps "stop" instead of "error")? You will need a separate parameter anyway to specify the destination of "log", unless "none" became an illegal table name when I wasn't looking. I don't buy that one parameter that has some special values while other values could be names will be a good design. Moreover, what if we want to support (say) log-to-file along with log-to-table? Trying to distinguish a file name from a table name without any other context seems impossible. regards, tom lane