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 1tpqrZ-00DDJo-DX for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 15:40:49 +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 1tpqrY-00ENgf-5L for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 15:40:48 +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 1tpqrX-00ENgW-OC for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 15:40:47 +0000 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tpqrV-00180g-2g for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 15:40:46 +0000 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-2a88c7fabdeso3817127fac.1 for ; Wed, 05 Mar 2025 07:40:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741189245; x=1741794045; 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=N3f5Rtf71BV+eEgO/DrNLJGMC0hoYrwsF+0O9frIB5s=; b=a2BZoedJRmQcLAYdDgwGri+OAN+R9hM1Y6PMKU6GrBGJB5uVldeUHG10XOX+TQ+4o2 PkDq7oCxjBrYhHle+4KjoFygStwfp/HMmfexn2p6LIAkAJRqFG97xKwCZdze48lPBjFY SmJQCnTN84uEcBd0LtUp259AywDsJdzSb0VivIJJPQ6a3rEzdPzZsj06GUo/D2AvXnAB ARQSaseFagBJ6B2ef2GP/yGL1crNc6PTTu9JlUfA6ENQyip1soSRvNmRnA0PMIOnu1m5 RLajRq2QzARhrhyRrD0mYOvXLDOt3C12D7ZINItbWO57f1MxGqbVmLNK6vli1uNAWah7 vNMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741189245; x=1741794045; 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=N3f5Rtf71BV+eEgO/DrNLJGMC0hoYrwsF+0O9frIB5s=; b=Vhf+6HIg5WwOup0vjavsIKllb+AHXrU5csIQLJciiv24kDC6DGgScGh/VpmwSm/7Bb c/RITqTH2NksWhxgywv2XBqKjxuZ++gB3OArliKjSN5/4PiCxUh2dAieJqOqioUwUQuu fQcAiznaqsPb8iEI4BL3KUkCjxWYlyKbSanX6xdsx5Z8sE3bIVqgZo7TCO7A2A0F0+3/ zZg7Q6A3Kt+XyrqS2O6wHV1elpHK1sGAg4JMXPPVTBaNGYiVU6xKghEzolmNl9azqzmJ 0xZ6wm/ajChA5Ejk1PKMaueom0IZg+lwrNO0+nkKFAwbUNU8IMD5Wqq96Odxa4/T7jlI OBow== X-Gm-Message-State: AOJu0YyGucTHL3ysfzCoCGlukga3MGiKSN4o4og1QhzWM5et7G82IvBB jrfiat4CPwLKRIESkQA/dG+KLkLeOVWCXsrpQUQW7aO99lwjmih+k1NhskyV0g2LuztJ8mWZ0gT DuCJnLOej6hYMNlfODqBEX4i0cwnqebWW X-Gm-Gg: ASbGncvszal1wUtMuRcLwS+YVk+X5TU7RD/XLCCVRGKlSzQLoaIOe5Po1NcNtOm1slA OFeWzhuYCxrAnETKdbM0QDNNHcrcotQ0pBAa/APeNGFmF9B8lpggUSXQ9yXz1ufhCdE7fsO/EGu 8n4iH9PnCishRzajmjct/MU7gitfsOshCNiiTC/FOoOvSSX30tHslSLG3iKPlC X-Google-Smtp-Source: AGHT+IGdmW7M+3y9SI0WQ2UNrRp3GU49ErroPQYynqBERDfLT4MsHfau3O4eT2NDUPyKH1Kf8wR0GkXEjtWCp5kGjck= X-Received: by 2002:a05:6870:9109:b0:2c1:9897:dd24 with SMTP id 586e51a60fabf-2c21ce43dafmr2257074fac.35.1741189244842; Wed, 05 Mar 2025 07:40:44 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Wed, 5 Mar 2025 10:40:33 -0500 X-Gm-Features: AQ5f1Jp0g_r11sDVqXHUnQhoKAilnHvqkiYZc9lrdTeVSZP81md6VXTcpWWXQJE Message-ID: Subject: Re: end of COPY To: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000006cfbce062f9a36df" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006cfbce062f9a36df Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 5, 2025 at 10:22=E2=80=AFAM Marc Millas wrote: > Hi, > on a Postgres 16 DB running on a redhat 8.5 x86 machineI want to input > some data using copy from stdin > so.. more that 700 000 lines goes well. > Then the flow contains a single line: \. > to my understanding this means end of the copy > I just tested this on PG 16.8. No backslash. $ psql TAP -Xc "copy public.job_notification TO STDOUT;" https://www.postgresql.org/docs/16/sql-copy.html "End of data *can be* represented by a single line containing just backslash-period (\.)." "the end-of-data marker (\.) or the null string (\N by default)." > but, Postgres generates an error : > invalid input syntax for type numeric "\." > then the 2 lines stating the copy command that was executed. > > what am I missing ? > COPY is expecting something after the backslash. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000006cfbce062f9a36df Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Mar 5, 2025 at 10:22=E2=80=AFAM M= arc Millas <marc.millas@mokadb= .com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">
Hi,<= /div>
on a Postgres 16 DB running on a redhat=C2=A08.5 x86 machineI wan= t to input some data using=C2=A0copy from stdin
so.. more that 70= 0 000 lines goes well.
Then the flow contains a single line: \.
to my understanding this means end of the copy=C2=A0

I just tested this on PG 16.8.=C2=A0 No back= slash.
$ psql TAP -Xc "copy public.job_notification TO STDOU= T;"
=C2=A0
https://www.postgresql.org/docs/16/sql-copy.html<= /div>
"End of data can be represented b= y a single line containing just backslash-period (= \.)."
= "the end-of-data marker (\.) or the null string (\N=C2=A0by default)."


but, Postgres generates an error=C2=A0:
<= div>invalid input syntax for type numeric "\."
then the= 2 lines stating the copy command that was executed.

what am I missing ?

COPY is expecting something after the backslash.

--
Death to <Redacte= d>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
--0000000000006cfbce062f9a36df--