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 1r0sN6-008GpN-AB for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Nov 2023 23:54:08 +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 1r0sN4-008pPv-LM for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Nov 2023 23:54: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 1r0sN4-008pPl-BQ for pgsql-hackers@lists.postgresql.org; Wed, 08 Nov 2023 23:54:06 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0sN1-004eVb-SU for pgsql-hackers@postgresql.org; Wed, 08 Nov 2023 23:54:05 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 970EB320096D; Wed, 8 Nov 2023 18:54:01 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 08 Nov 2023 18:54:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type: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=1699487641; x=1699574041; bh=jf 7qZ3qLcjX52A1NQ+AExUBwnrLoAIj57UFjdbik/kY=; b=G8ftWdRARGtB9+KW4p niHtuzGx9LtI3nip7zBBwdcGdd/SZH0yBrHb/B2qjAt/rYrPFUctUy8/J7AILvw8 RVvxvz+rWyvacN1y6tZRob8dESMbgtMvkP0hwda8UmOQpvfPQktIE3oIEheI/dxI Jra+x9sKsRppEjhkKJmQf8wYkkZBjwzwEuhUFBjciaV22+zOESpYW4iwueGADb5a IIa0Le+VJ/fh3opL4RVInlWD1TQt/3ogOKGbchWocHJjlkctfvp4W2emV7CTjShW dKxvR7eOAELjDUPywHgTnWWp3V4Av1FBJxl4iVShG3x6XFEwL+PzouOKgcrRCE07 Yc5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type: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=1699487641; x=1699574041; bh=jf7qZ3qLcjX52 A1NQ+AExUBwnrLoAIj57UFjdbik/kY=; b=IhdEZLxuNXmT0BbymlrlxhYkQ7tsd hGm5vrdUwH0KkLxU8B+8tIzcOKktq6MFJb3qOhAheELd97d7MGhGd9ynKXUk4+fG 2B2Lrt+qG/9HWRYc9LmRu3b4grzJcSNil+NydwtrreixEbYZb+s2cQs+kpihR4yl XbBip5WxQ3GjXtvxYPV0lwWwCwgDST1sDR3JaW08hnyyIKYIwI+HGkIxL38fM6gN 5uc12vlz+W0jYLecy4NjfwDrWkCWyvksZULV/ThBikRz0svtVuX/pNk7ns5J4NbU w7Ulq27/qekvEPFLX5RnfXjO8lH2cN+UpOJm/nZ5nvfJ/w8eVQ/GDC0Gg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddvtddgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Nov 2023 18:53:59 -0500 (EST) Date: Wed, 8 Nov 2023 15:53:58 -0800 From: Andres Freund To: Tom Lane Cc: Damir , torikoshia , Pgsql Hackers , daniel@yesql.se, anisimow.d@gmail.com, HukuToc@gmail.com, Andrey Lepikhov , Alena Rybakina Subject: Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features) Message-ID: <20231108235358.jmay4ps767mecrnu@awork3.anarazel.de> References: <43399b33fe573f0548410893f41f84b6@oss.nttdata.com> <8de9d5e1-2f81-ee2e-ece4-b1a6ede1f285@yandex.ru> <58fa3b63e88ffd0a09273e38aec0661e@oss.nttdat! a.com> <739953.1699467519@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <739953.1699467519@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-11-08 13:18:39 -0500, Tom Lane wrote: > Damir writes: > > [ v7-0002-Add-new-COPY-option-IGNORE_DATATYPE_ERRORS.patch ] > > Sorry for being so late to the party, but ... I don't think this > is a well-designed feature as it stands. Simply dropping failed rows > seems like an unusable definition for any application that has > pretensions of robustness. Not everything needs to be a robust application though. I've definitely cursed at postgres for lacking this. > I think an actually usable feature of this sort would involve > copying all the failed lines to some alternate output medium, > perhaps a second table with a TEXT column to receive the original > data line. (Or maybe an array of text that could receive the > broken-down field values?) Maybe we could dump the message info, > line number, field name etc into additional columns. If we go in that direction, we should make it possible to *not* use such a table as well, for some uses it'd be pointless. Another way of reporting errors could be for copy to return invalid input back to the client, via the copy protocol. That would allow the client to handle failing rows and also to abort if the number of errors or the type of errors gets to be too big. Greetings, Andres Freund