pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Nick Renders <postgres@arcict.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PostgreSQL 14: pg_dump / pg_restore error: could not write to the communication channel: Broken pipe
Date: Fri, 15 Oct 2021 12:33:00 -0400
Message-ID: <961250.1634315580@sss.pgh.pa.us> (raw)
In-Reply-To: <202110151313.dk4fatdj4qii@alvherre.pgsql>
References: <202110151313.dk4fatdj4qii@alvherre.pgsql>

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2021-Oct-15, Nick Renders wrote:
>> I have been trying to import a Postgres 11 database into Postgres 14, but
>> the pg_restore command exits with the following message:
>> pg_restore: error: could not write to the communication channel: Broken
>> pipe
>>
>> It seems that the multiple jobs parameter is the cause. If I specify "-j 1",
>> the command works without problems. If I specify "-j 2" or higher, I get the
>> above error after a few seconds.

> Yeah, pg_dump in parallel mode uses a pipe to communicate between leader
> and workers; the error you see is what happens when a write to the pipe
> fails.  It sounds to me like something in the operating system is
> preventing the pipes from working properly.  I don't know anything about
> macOS so I can't help you with that.  I can tell you however that this
> error has not been reported previously.

I tried to reproduce this on my own 2019 MacBook Pro running Big Sur
(11.6), without success.  I made a test database with

do $$
  begin
    for i in 1..5000 loop
      execute 'create table t'||i||' as select generate_series(1,100000) x';
  end loop;
end $$;

and then ran dumps and restores with the same parameters you used.
No sign of trouble.

I concur with the request to look in the postmaster log to see if
anything interesting shows up on that side.  Also, does the
behavior change if you don't use "-h localhost" but instead let it
default to a Unix socket?  (I don't have any real reason to think
that it would change, but we're grasping at straws here.)

			regards, tom lane





view thread (7+ messages)  latest in thread

Message-ID: <961250.1634315580@sss.pgh.pa.us>
Permalink:  ../961250.1634315580@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/961250.1634315580@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, postgres@arcict.com
  Subject: Re: PostgreSQL 14: pg_dump / pg_restore error: could not write to the communication channel: Broken pipe
  In-Reply-To: <961250.1634315580@sss.pgh.pa.us>
  References: <202110151313.dk4fatdj4qii@alvherre.pgsql> <961250.1634315580@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox