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 1v1sGq-00DaDA-Ou for pgsql-general@arkaria.postgresql.org; Thu, 25 Sep 2025 20:08:52 +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 1v1sGp-005WvJ-6l for pgsql-general@arkaria.postgresql.org; Thu, 25 Sep 2025 20:08:51 +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 1v1sGo-005Wud-SS for pgsql-general@lists.postgresql.org; Thu, 25 Sep 2025 20:08:50 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v1sGl-0005It-0l for pgsql-general@lists.postgresql.org; Thu, 25 Sep 2025 20:08:50 +0000 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-7827025e548so797805a34.2 for ; Thu, 25 Sep 2025 13:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758830925; x=1759435725; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=m7pyCYpurYnuEnVHJR3nuZZ9LGFSXZLRU01R4aDnTe8=; b=J4sXvHYNd8AacZhCF5MjQP+eZ3Ud58B3mRQ2kKqlcfbzONIqJh/PkKyiJeXzKvt7nC jRJolkwTDVLoGCtqdey+CzzzCK2t2bQEXSD50qttNjOVquQ6qTVxfr6iRsNsjjy2JGmD PCfcNtIQLIr0Zg4YfSN0Hf7Jij/1G3oGRKcR3VTto008qG/3teb3WMr/1wif4sfw8VFW 8iP0RC6XvK+FF0zyp7/++/dbB7XtWXXFtnP+eImgApAG7j6kjaPUE/6HeLvQAf/4BOgq vMNA9LXUHEupUOgOhW2qdMFT4Cqz87Os27B9h14EWaLYAlf1+IW5ZuAo0/0qKA0BAGvC YLHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758830925; x=1759435725; h=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=m7pyCYpurYnuEnVHJR3nuZZ9LGFSXZLRU01R4aDnTe8=; b=LZdtyk0z0LojbruWvRQZ8WIFYt9JepOVF77QnjfKUaB7p8YUIrcpEtuWDHOjQzWAZJ 8eaG315PW63d2xSgASOvj88DXwWeOtgDCXK+8P7pAG9myzmCPMiZWtIh6imNSjZpEQNu nPWCLn8Hq53nkCRfNuzmFXLRUHeJLDESgaPRfWbbhbmt2OzeOuP7RAdqbXoBmI6j6P1t FrX8c1e1EAut6MmmhltO/MGIJeiDmRRdBQseCek8VYYh2RtaORpMvjJO5MEKmKqtWEux 7Nqvv4hr42oJK/jvF55wMOGquB8xwqOrBaVyeBt2Kj8X3q++g2chBher3IdV/nn+3X41 wkuQ== X-Gm-Message-State: AOJu0Yww0ZgxQfSLnPQv9Xd08IF4WzryxEEd3pHMT8sxVfuL/4WcwgIe rxRziK4oZsHmR5W2CfMxvRYIleXAsjXZwCV1yKu5hVvjx7SwKmwwoy7xJpxZJX4gJHq1SteXLtY IW6Gl+z6DYmdGZAUo8S1BY6vEfwoDBVpEFg== X-Gm-Gg: ASbGncu1+g1+ekK/bqcUWvapHEzl+D1bDCg03NinVt2IsG1ia56RC5CwyjthA0uEvPR k5SQIQ4vYUPdhuGxwj2d2SFt+DVdURJfkbfgOGLxR0roDwB/9ZI86F8r4OojZ82Zl659RRUYKY2 lW1bUYCTYCzfDhAHetWmWuHIsFgLm1nvtGJbxBNQA4IBX/nmLjhRfu97cQW3dchqUNpGKHAiGvO 06bAWOE X-Google-Smtp-Source: AGHT+IHVCfEg5+18Dy6HwItHPysJqtawx5CY3+nBHknG8vp3AMe1c+XfbAYe29C3jEPxd2ov+iQYmlWvtTgEdKjJTMs= X-Received: by 2002:a05:6808:1247:b0:40d:547d:397 with SMTP id 5614622812f47-43f4cdebfdemr2495013b6e.23.1758830924845; Thu, 25 Sep 2025 13:08:44 -0700 (PDT) MIME-Version: 1.0 References: <80c44b4d-1185-478b-939c-62e0d4377106@gmail.com> In-Reply-To: <80c44b4d-1185-478b-939c-62e0d4377106@gmail.com> From: Ron Johnson Date: Thu, 25 Sep 2025 16:08:34 -0400 X-Gm-Features: AS18NWCT2BfH65hmq9IJlRDeeJNafqY9xG9CoMciZV7C9QJP0K2vB9nXSCkR-p0 Message-ID: Subject: Re: Additional options for COPY from To: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000007ed6cf063fa5bcba" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007ed6cf063fa5bcba Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 25, 2025 at 3:49=E2=80=AFPM Bryan Sayer wr= ote: > Hi, > > I'm not sure if this is the best list to ask this (and I am very new to > PostgreSQL) but I think more options are needed in the COPY from command, > in order to better deal with exceptions. By exceptions I mean data not > consistent with the format, empty rows, extra delimiters at the end of > rows, etc. > PG 17 COPY has ON_ERROR. > Is there someone or a party that deals with the details of the COPY > command that I could discuss this with? > > Just for context, I am dealing with delimited data of millions of rows an= d > perhaps 60 columns or so that I wish to read into tables in a Postgres 17 > database under Windows 11, with everything on local drives. > COPY is pretty simplistic. 3rd party CSV loaders like pgloader and pg_bulkload exist for that reason. And there's always Python & Perl for when your data is really dirty. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000007ed6cf063fa5bcba Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Sep 25, 2025 at 3:49=E2=80=AFPM B= ryan Sayer <brysayer@gmail.com= > wrote:
=20 =20 =20

Hi,

I'm not sure if this is the best list to ask this (and I am very new to PostgreSQL) but I think more options are needed in the COPY from command, in order to better deal with exceptions. By exceptions I mean data not consistent with the format, empty rows, extra delimiters at the end of rows, etc.

=
PG 17 COPY has ON_ERROR.
=C2=A0

Is there someone or a party that deals with the details of the COPY command that I could discuss this with?

Just for context, I am dealing with delimited data of millions of rows and perhaps 60 columns or so that I wish to read into tables in a Postgres 17 database under Windows 11, with everything on local drives.

COPY is pretty simplistic.= =C2=A0 3rd party CSV loaders like pgloader and pg_bulkload exist for that r= eason. And there's always Python & Perl for when your data is reall= y dirty.

-= -
De= ath to <Redacted>, and butter sauce.
Don't boil me, I'm s= till alive.
<Redacted> lobster!
<= /div>
--0000000000007ed6cf063fa5bcba--