Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOuQo-0006Ip-DT for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Feb 2023 05:52:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pOuQm-0002K8-I7 for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Feb 2023 05:52:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOuQm-0002JZ-8V for pgsql-hackers@lists.postgresql.org; Mon, 06 Feb 2023 05:52:44 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOuQk-0004Lj-16 for pgsql-hackers@postgresql.org; Mon, 06 Feb 2023 05:52:43 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id CCF91320076F; Mon, 6 Feb 2023 00:52:38 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 06 Feb 2023 00:52:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1675662758; x= 1675749158; bh=8J9caapXhFm575SSmihewLwlpclON/93UZRwp1L5oHE=; b=E UqhTx9OV8dfDKnLQlmd7gdC0Arf90itdw4vYY/zsmjT04dWBpwSEMZYVzdmRqBip Q4dgZ1QcPSEBt6A4HyvmT4MbCbGGcsLpXPyemvUU3WtwVlXnDrziCUaWx1diHFuF BWYhJ4YC1i3o8SNqsrX4+dqDZqCSUguF+QdmfmCQdVePnMhs54EjJJbXQs36xD6k vjlmmKITH+AySGpZTXRM9m5jgEBlPdmQKT6iCROFoONc0TIEVMiVTaZ9SwgjLJtu oZFI7hVcRoL/Tosc8BW7e3r/SEFWCmIbyuDskfgP2bCo3ezObpk4uoy0TqhE58cm OxRhp4CXnERfbCVedH1HQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1675662758; x= 1675749158; bh=8J9caapXhFm575SSmihewLwlpclON/93UZRwp1L5oHE=; b=m T0iZf6LUW7wUoAdPtv5Qpf1wdwcvdBMsXax/8th9UjOnOVrrhjAA+7lKwe/o0d75 f4seY+LLKsy4HlZLO10cYKrNG0yrKrfJNpxsjh6xHyotdLOKpAGF653/tEykpbLt wM/SycNa1hqZngCf/0X9/i9UBbe79sW6okc4WZYueEdaQa+Uw1dIUngU8VkT/gdP UY8MKKV34wuKMkwCqqDunrZX/r9NTKELgYdMl+MXs6nkDYQ0YJGWarldxxa0kF/o +QYfN3dQ+gNh3YzMB0jXyux8q4cr46hEc9ky7coDSqQ/4wOw5ljmlQ4bYRPtNtBj DapAr/C6FI7LbXpSyb8xg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeghedgkeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevufgfjghfkfggtgfgsehtqhhmtddtreejnecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtf frrghtthgvrhhnpefhgfekheettdegveevtddthfelueehjedvteevfffhgfejudeigeej geekiedtffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Feb 2023 00:52:37 -0500 (EST) Date: Sun, 05 Feb 2023 21:52:33 -0800 From: Andres Freund To: Tom Lane , Damir Belyalov CC: Danil Anisimow , "HukuToc@gmail.com" , torikoshia , "a.lepikhov@postgrespro.ru" , PostgreSQL Hackers Subject: Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features) User-Agent: K-9 Mail for Android In-Reply-To: <2587470.1675660337@sss.pgh.pa.us> References: <686e46d6718f9535bc39fac7cad7408b@oss.nttdata.com> <769423519e16d18a1e7611c6931da58b@oss.nttdata.com> <20230205233723.xw5z5zmeyc57ezq3@alap3.anarazel.de> <2587470.1675660337@sss.pgh.pa.us> Message-ID: <483E1B59-4A80-450B-8685-7CC12762FD5A@anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi,=20 On February 5, 2023 9:12:17 PM PST, Tom Lane wro= te: >Damir Belyalov writes: >>> I don't think this is the right approach=2E Creating a subtransaction = for >>> each row will cause substantial performance issues=2E > >> Subtransactions aren't created for each row=2E The block of rows in one >> subtransaction is 1000 (SAFE_BUFFER_SIZE) and can be changed=2E > >I think that at this point, any patch that involves adding subtransaction= s >to COPY is dead on arrival; whether it's batched or not is irrelevant=2E >(It's not like batching has no downsides=2E) Indeed=2E >> InputFunctionCallSafe() is good for detecting errors from input-functio= ns >> but there are such errors from NextCopyFrom () that can not be detected >> with InputFunctionCallSafe(), e=2Eg=2E "wrong number of columns in row'= '=2E > >If you want to deal with those, then there's more work to be done to make >those bits non-error-throwing=2E But there's a very finite amount of cod= e >involved and no obvious reason why it couldn't be done=2E The major prob= lem >here has always been the indefinite amount of code implicated by calling >datatype input functions, and we have now created a plausible answer to >that problem=2E I'm not even sure it makes sense to avoid that kind of error=2E And invali= d column count or such is something quite different than failing some data = type input routine, or falling a constraint=2E=20 --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E