agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: Christoph Berg <myon@debian.org>
To: Zsolt Parragi <zsolt.parragi@percona.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: COPY TO regression with psql -c
Date: Wed, 12 Aug 2026 10:37:18 +0200
Message-ID: <anwwvl-fzGIbpk77@msg.df7cb.de> (raw)
In-Reply-To: <CAN4CZFPqa6c+u4uX5jJ8LANHTQ4dxM3m4_8G9WmX_A4-2wuv2A@mail.gmail.com>
References: <CAN4CZFPqa6c+u4uX5jJ8LANHTQ4dxM3m4_8G9WmX_A4-2wuv2A@mail.gmail.com>
Re: Zsolt Parragi
> psql -c "SELECT 1; COPY t FROM STDIN;"
The Debian package tests are also tripping over this. The test case
there is (in the encoding test file, hence the weird chars):
printf '���' | psql -qc "set client_encoding='iso-8859-5'; create table t (x varchar); copy t from stdin"
SET
CREATE TABLE
unexpected COPY_IN result, aborting connection
2026-08-12 10:31:46.434 CEST [77760] ERROR: unexpected EOF on client connection with an open transaction
2026-08-12 10:31:46.434 CEST [77760] CONTEXT: COPY t, line 1
2026-08-12 10:31:46.434 CEST [77760] STATEMENT: set client_encoding='iso-8859-5'; create table t (x varchar); copy t from stdin
2026-08-12 10:31:46.434 CEST [77760] LOG: could not send data to client: Broken pipe
2026-08-12 10:31:46.434 CEST [77760] STATEMENT: set client_encoding='iso-8859-5'; create table t (x varchar); copy t from stdin
2026-08-12 10:31:46.434 CEST [77760] FATAL: terminating connection because protocol synchronization was lost
> This is probably an uncommon use case, but it has a few legitimate
> uses in scripts, such as:
>
> gzip -dc data.csv.gz | psql -c 'TRUNCATE t; COPY t FROM STDIN WITH (FORMAT CSV)'
I think that's a pretty common case. This "create and copy" is another example.
Christoph
view thread (7+ messages) latest in thread
Message-ID: <anwwvl-fzGIbpk77@msg.df7cb.de>
Permalink: ../anwwvl-fzGIbpk77@msg.df7cb.de/
Also on: postgresql.org/message-id/anwwvl-fzGIbpk77@msg.df7cb.de
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: myon@debian.org, zsolt.parragi@percona.com, pgsql-bugs@lists.postgresql.org
Subject: Re: COPY TO regression with psql -c
In-Reply-To: <anwwvl-fzGIbpk77@msg.df7cb.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox