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 1toPpO-00ARw3-Hy for pgsql-general@arkaria.postgresql.org; Sat, 01 Mar 2025 16:36:39 +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 1toPpP-00GmnC-9Y for pgsql-general@arkaria.postgresql.org; Sat, 01 Mar 2025 16:36:37 +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 1toPpO-00Gmn4-Si for pgsql-general@lists.postgresql.org; Sat, 01 Mar 2025 16:36:37 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1toPpJ-000Njk-2c for pgsql-general@lists.postgresql.org; Sat, 01 Mar 2025 16:36:37 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-7271239d89fso1037720a34.0 for ; Sat, 01 Mar 2025 08:36:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740846993; x=1741451793; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2bPc8qhFGQIV2ptfHNdZD7U/rlcEOx4uygx6Pw0M3Pk=; b=M2kIMdRhKWUBLGOjEuQEeIQtuhY6ajW3RoqymvpO755zRo261Q1K/Huk+J9ZsWkbNF Tlpschz632rfvq3U1ldtqz+fsDThBu1tpr5pZyNyylYvoXLFbFBEJEafzlVlqCMWJa5d QTG662fXLpl6KdulTL/w31vxmzTzi7xzN74iRaJThvukhF5n+YOSRg08XsXBMu9BLQGi Nl2h1zqrZ3R/+AtCRXfWo1lR5FPiO3uK8Mr5HL/P5zqfugJFSBxOvFawnx+pjvN+QOdK NU88mCCRSU9H+OjulP3izLiEFMpbap3pYB3+vVDYr40AX2bTqOaBcsVu/avokWRD+0y8 I6Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740846993; x=1741451793; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2bPc8qhFGQIV2ptfHNdZD7U/rlcEOx4uygx6Pw0M3Pk=; b=vCShoxBG3RNE9VBJ9gihBCdoB0KT/uSdW6FQYkya6KfJVSru8O06g3ezxndq264t8X Iiko/Cu2my5lxKQfyFAC6Q1UESV+YeFC9XMnWVz5x26LhLxtMN62Ic8UivC2DpLNKQYW jpZNI9qAwBN9JNPjfzgF9fMxKQDn/8DcNg4UmNOoTsHbQpyT1QEbCWql7MLFT09CFSO9 Iz2nTCsoqlks7d1bT/eF+y+r/0CdYa18PwjCTO70v8Nt40Yxg4qUdrDlaJCltjM4p5Dv mtHJwIPrmznP9bZatAJMoPj/C1yk+nPayzDd8SQQ83n5CZYPrJvxUGhmyZXYc6W0lkbO FmrA== X-Forwarded-Encrypted: i=1; AJvYcCWjsByvm5bgJBLFTvkzJ3X69Jd0abagBFh6ee+gCPq8EZnhd2Hi2VA2PscZ8kvbkDUhrv2syLWikUKlOMR4@lists.postgresql.org X-Gm-Message-State: AOJu0YwLMktPribLlcMO0z/N/93/B+Azr7qTSMe/Z7Zy5ZMKtisU1lrV VwZt7qEf3M8550YXKzO/717mf/8O7d6AgsRCOq7V2rKyoyNKI2MpoSuEzZVXWILw0A0Gh81W4he rTHTDWoa5RJAo9rQozhoiE4j/H5I= X-Gm-Gg: ASbGncsb1ZuSDaF3ONE3vudCKWUSbMTeLyIBDoLYK3moooBsUHlotouw2iOx6DxXrDB 8M06H+yOVfyzg4apuvDG60hpKag2+krreYzoEDIpJv1Nopghr/aRaq32wt6R2ubKE34MsGu9puq sJTQjNp8jZKWj2tQux0Blz+/5t X-Google-Smtp-Source: AGHT+IEA6TZNYGLUeVCzDy0X275K6Qvry5N7hNdoyB5WLoh/PKqKYsV4pDushQTqWy0ixlFZQ1k1tZp/hdP23b0sxQI= X-Received: by 2002:a05:6830:6d89:b0:727:2a33:a10a with SMTP id 46e09a7af769-728b82fcb90mr4618382a34.17.1740846993282; Sat, 01 Mar 2025 08:36:33 -0800 (PST) MIME-Version: 1.0 References: <2961422.1740846012@sss.pgh.pa.us> In-Reply-To: <2961422.1740846012@sss.pgh.pa.us> From: "David G. Johnston" Date: Sat, 1 Mar 2025 09:35:54 -0700 X-Gm-Features: AQ5f1JpeNqq_yW3NpnCdxZulhVwtKDrJP0FB1n6J6IFlbMVLbJva7g-VOa_XtEY Message-ID: Subject: Re: Please implement a catch-all error handler per row, for COPY To: Tom Lane Cc: me nefcanto , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000a4a2b3062f4a861b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a4a2b3062f4a861b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Mar 1, 2025 at 9:20=E2=80=AFAM Tom Lane wrote: > me nefcanto writes: > > Can you please provide a row-level catch-all handler for the copy > command? > > Very unlikely to happen. COPY is not intended as a general purpose > ETL mechanism, and we don't want to load it down with features that > would create substantial performance penalties. Which that would. > Maybe it isn't a general purpose ETL tool but there is no reasonable way to do some things unless COPY can be put into a mode that doesn't have the same performance requirements it needs to serve as our dump/restore tool of choice. I have to imagine such a mode, if not enabled, would have little to no impact on how COPY behaves compared to today. It's kinda like VACUUM FULL existing doesn't impact how VACUUM behaves. Seems more desirable than inventing a whole new SQL Command to do this and copy-paste all of the COPY code since it does mostly the same thing. In short, it's probably worth giving it a try if someone wants to. Rejecting it without seeing the proposal seems premature. Now, it's probably challenging enough that if the person requesting the feature isn't driving its development the odds of it getting worked on is fairly low. David J. --000000000000a4a2b3062f4a861b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Mar 1, 2025 at 9:20=E2=80=AFAM Tom Lane <tgl@sss.pgh.pa.us> wrote:
me nefcanto <sn.1361@gmail.com> writes:
> Can you please provide a row-level catch-all handler for the copy comm= and?

Very unlikely to happen.=C2=A0 COPY is not intended as a general purpose ETL mechanism, and we don't want to load it down with features that
would create substantial performance penalties.=C2=A0 Which that would.
=

Maybe it isn't a general purpose ET= L tool but there is no reasonable way to do some things unless COPY can be = put into a mode that doesn't have the same performance requirements it = needs to serve as our dump/restore tool of choice.

I h= ave to imagine such a mode, if not enabled, would have little to no impact = on how COPY behaves compared to today.=C2=A0 It's kinda like VACUUM FUL= L existing doesn't impact how VACUUM behaves.=C2=A0 Seems more desirabl= e than inventing a whole new SQL Command to do this and copy-paste all of t= he COPY code since it does mostly the same thing.

In s= hort, it's probably worth giving it a try if someone wants to.=C2=A0 Re= jecting it without seeing the proposal seems premature.

<= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ">Now, it's probably challenging enough that if the person requesting t= he feature isn't driving its development the odds of it getting worked = on is fairly low.

David J.
--000000000000a4a2b3062f4a861b--