Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbQ9a-0003E5-Vr for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 16:33:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbQ93-0007Ib-RJ for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 16:33:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbQ93-0007IS-Hl for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 16:33:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbQ91-0000NW-7s for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 16:33:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 19FGX0oI961251; Fri, 15 Oct 2021 12:33:00 -0400 From: Tom Lane To: Alvaro Herrera cc: Nick Renders , pgsql-general@lists.postgresql.org Subject: Re: PostgreSQL 14: pg_dump / pg_restore error: could not write to the communication channel: Broken pipe In-reply-to: <202110151313.dk4fatdj4qii@alvherre.pgsql> References: <202110151313.dk4fatdj4qii@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Fri, 15 Oct 2021 10:13:28 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <961249.1634315580.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 15 Oct 2021 12:33:00 -0400 Message-ID: <961250.1634315580@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > On 2021-Oct-15, Nick Renders wrote: >> I have been trying to import a Postgres 11 database into Postgres 14, b= ut >> 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 ge= t 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