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 1toOcE-00ACqx-5z for pgsql-general@arkaria.postgresql.org; Sat, 01 Mar 2025 15:18:59 +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 1toOcD-00FIVR-SL for pgsql-general@arkaria.postgresql.org; Sat, 01 Mar 2025 15:18:56 +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 1toOcD-00FIOP-ER for pgsql-general@lists.postgresql.org; Sat, 01 Mar 2025 15:18:56 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1toOcA-000Mku-0R for pgsql-general@lists.postgresql.org; Sat, 01 Mar 2025 15:18:55 +0000 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2fe82414cf7so6076760a91.0 for ; Sat, 01 Mar 2025 07:18:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740842332; x=1741447132; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=O7TJUqfZ8e3tEakiMWeAkN3u8CVt+Rp3MOFxj/LUXbI=; b=OhOS5VDRHMB2TTnC33XrD8JDO4sKH17pc0Gq2vco4Lskb4WNC4JaVOnKaOrxC8yxuL sUWKwNmQrjFueQsi+l/ZATPj4oTj2NkjCBF6dGTwI23RTWIH/L4pYPxZB2ZQjgQNe3NI SO5MqXaKl8CNByIePgnM0LTPJyKFU6znrh/6ThCqSXJdVyUjabxAPpwOtqD4NABdG4Pd 8qGZAg74Ww0tgNsRMaqQwQL3k/6xjDs8YCtvljcOwVJSHw99njpyPtUPpaqxHHO/Layi hskG1Rtnet0g0dK/31dVMRsu5c+zjWrEmZ2f+27jRtFVSk79NH/py1X/vXCV+zDK9t4K eKIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740842332; x=1741447132; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=O7TJUqfZ8e3tEakiMWeAkN3u8CVt+Rp3MOFxj/LUXbI=; b=fDEIXM+hM/IGhe7Kpdnvekxfs9QAWI9yxQ1+LfkC8JcD1D+kfyevif1fppRecrA53G pT7whRlOO/ZDbRircnKQ1CGyU4Zkvi5Ib0pihNKYfoYDs8AO21VxSXACXYsBEmSHUqLC sZSvf74XiGSUkBvycAAOnflH20nRDwHnbgKF4v/wnUCnMLfCcpUyhsFZCKE5C0AK/9kl ydhpC50pqMjspLdugj29kBJSatfzCezKeJ8Y7MGHPoAEaCdiOOE2EW2KCUOBlunuM0hf 5Q8p/zzPWReSWLCht7ZwwXyBV5LZVWxMMarJSWnwOkk88mhojbDFK4Cnm6KyDoDofbDZ twNg== X-Gm-Message-State: AOJu0Yyup+F6onIMmo5du+eAgtsR/VRzPP/w0VaSfLA1qvTq0KkX12Mn LMVzQMVo6ntqr43qQb4todsAmdQob9mvUUhmeRZW4F+iBIqnGpAR8UzVyWLxl1TXROlzdJ1jKib Agp9LC8uVV/u2248QAUFwQNsCCcjBxvZEBEW34qxH X-Gm-Gg: ASbGncub0V2bpnL6gs9iygvlwL2j4OnsNMVKPe38PwfLsM+Nl5TeuXCxO7jh0Ty2Abp XmDUwWASuzeigsBmOXo1uIgDGEyqF6FnTabn9nm8CjAdTpViibNQsKuLPQ7fsAebBm8Qv8oe2NN 0tUwD1wN/ivF5/XM69PKeEcGRToQ== X-Google-Smtp-Source: AGHT+IHunmPV3dr6qC9ezxQYLS4gRR3aBv7jlam8yKQbQslVv/+84qs/lhDhBsXHpRCAa0eZwB14UdVTUNpWuMsePYg= X-Received: by 2002:a17:90b:3ec9:b0:2ee:9e06:7db0 with SMTP id 98e67ed59e1d1-2febab50f40mr12187969a91.11.1740842332370; Sat, 01 Mar 2025 07:18:52 -0800 (PST) MIME-Version: 1.0 From: me nefcanto Date: Sat, 1 Mar 2025 18:48:41 +0330 X-Gm-Features: AQ5f1JqKGBQWULQdNBKkYVQ3ovzhfsL-Kg9y4eCEKm15AFzH1LOoaMUfS3LnpOY Message-ID: Subject: Please implement a catch-all error handler per row, for COPY To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000d4be81062f4970f9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d4be81062f4970f9 Content-Type: text/plain; charset="UTF-8" Hello Please consider these scenarios: - I want to create a million fake products, sometimes even 100 million (we're on MariaDB now and we plan to migrate to Postgres). My team uses fake data for performance tests and other use cases. - Another scenario is translations. Even in production, we have translation files for more than 20 languages, and for more than 2 thousand keys. That means we need to insert 40 thousand translation records in the production. - Another scenario is updating nested model values for a large hierarchical table. For example, the categories table. Anytime the user changes a record in that table we need to recalculate the nested model for the entire categories and bulk update the results. All of these scenarios are such that data sanitation is difficult if not possible before doing the bulk operation (copy). I realized that when we specify `on_error ignore` it just handles a handful of errors. I thought this was a bug and sent an email to the pgsql-bugs maling list. But they said it's the intended behavior. Can you please provide a row-level catch-all handler for the copy command? Regards Saeed --000000000000d4be81062f4970f9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello

Please consider these scenarios= :

= - I want to create a million fake products, sometimes even 100 million (we&= #39;re on MariaDB now and we plan to migrate to Postgres). My team uses fak= e data for performance tests and other use cases.
- Another scenario is translations. Even in production, we have tr= anslation files for more than 20 languages, and for more than 2 thousand ke= ys. That means we need to insert 40 thousand translation records in the pro= duction.
- Another scenario is updating n= ested model values for a large hierarchical table. For example, the categor= ies table. Anytime the user changes a record in that table we need to recal= culate the nested model for the entire categories and bulk update the resul= ts.

All of these scenarios are such that data sanitation is difficult if not = possible before doing the bulk operation (copy).

I realized that when we spec= ify `on_error ignore` it just handles a handful of errors. I thought this w= as a bug and sent an email to the pgsql-bugs maling list. But they said it&= #39;s the intended behavior.

Can you please provide a row-level catch-all han= dler for the copy command?

Regards
Saeed
--000000000000d4be81062f4970f9--