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 1n0RpU-0008Kw-EA for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Dec 2021 17:24:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n0RpT-0007kS-B4 for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Dec 2021 17:24:35 +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 1n0RpT-0007kI-1d for pgsql-bugs@lists.postgresql.org; Thu, 23 Dec 2021 17:24:35 +0000 Received: from smtp4-g21.free.fr ([212.27.42.4]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n0RpQ-0006EJ-So for pgsql-bugs@lists.postgresql.org; Thu, 23 Dec 2021 17:24:34 +0000 Received: from zimbra15-e2.priv.proxad.net (unknown [172.20.243.165]) by smtp4-g21.free.fr (Postfix) with ESMTP id 93F4F19F59C; Thu, 23 Dec 2021 18:24:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1640280270; bh=0qbH4do3e/PiGi8nFw7kA4naxl6hxqGIh0Us/jGNZqE=; h=Date:From:To:Cc:In-Reply-To:Subject:From; b=QeG8vl+WshWZw0DzvMfIcm/s8W0zW2Ugk8ggzOcLDNQSSQGP9pLjRgvchMN7v1PwL WvzqDNqOsYo5r3YPm14H3dNEKdtNSv/rXoD5s1IkAtGXh1nevVTWegbhGkEBhQreL7 L9OUeUToT7HRudDx9oLAHlghumd/7H2uRc+x8lroXmUptxJkfmgvQFkC7bRdGFzQ3v 0GkDUmolf/JhVyuXKT7OEKNZJdk0MmU/3G8V3k/yXVTI2eglQJeIsMxZIWe1lNrw45 hChqQZPnpNpEQbwiWujwxsZ5hOy7/ld6Rgl47t0QJ4UezjlG9px0pDpQ3iPbZhZuWU YkGkAh7iksncQ== Date: Thu, 23 Dec 2021 18:24:30 +0100 (CET) From: gparc@free.fr To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org Message-ID: <1234923880.68403843.1640280270313.JavaMail.root@zimbra15-e2.priv.proxad.net> In-Reply-To: <288243.1640197708@sss.pgh.pa.us> Subject: Re: BUG #17342: pg_restore with jobs > 1 errors out : a worker process died unexpectedly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [145.242.20.125] X-Mailer: Zimbra 7.2.0-GA2598 (ZimbraWebClient - FF3.0 (Linux)/7.2.0-GA2598) X-Authenticated-User: gparc@free.fr List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Tom, thanks for your answer. There is no direct access between source and target server so I will restore without job (-j) option. By chance, the schema size to restore is not so huge. Regards ----- Mail original ----- De: "Tom Lane" =C3=80: gparc@online.fr Cc: pgsql-bugs@lists.postgresql.org Envoy=C3=A9: Mercredi 22 D=C3=A9cembre 2021 19:28:28 Objet: Re: BUG #17342: pg_restore with jobs > 1 errors out : a worker proce= ss died unexpectedly PG Bug reporting form writes: > I'm migrating from PostgreSQL 9.1.24 to PostgreSQL 12.7 > On the source machine (9.1.24), the export process is done like this : > pg_dump --schema=3D$SCHEMA --no-owner --format=3Dcustom $BASE --no-passwo= rd > --verbose -f $DUMPFILE > On the target machine (12.7), the import process is done like this : > export PGOPTIONS=3D"-c maintenance_work_mem=3D512MB" > pg_restore --no-owner --no-tablespaces --dbname=3D$BASE --username=3Dpost= gres > --role=3D$ROLE --schema=3D$SCHEMA --no-password --verbose --jobs=3D4 > --exit-on-error > And I get the following messages : > pg_restore: error: could not execute query: ERROR: there is no unique > constraint matching given keys for referenced table "" > Command was: ALTER TABLE ONLY > ADD CONSTRAINT FOREIGN KEY () REFERENC= ES > (column_name); > pg_restore: error: a worker process died unexpectedly > =3D=3D> if I omit --jobs option or use --jobs=3D1, i get no errors > I saw this type of error presumably fixed in 12.4 but I'm on 12.7 12.5, actually. But the point is that you need to use 12.5 or later pg_dump to get the benefit of the fix. 9.1's pg_dump will produce an archive with insufficient dependency links, allowing the parallel restore to execute steps in the wrong order. You could use the 12.7 installation's pg_dump to extract data from the old server. However, doing that across the network might slow things down enough to outweigh the benefit of being able to restore in parallel later. =09=09=09regards, tom lane