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 1rmEAX-006klC-5w for pgsql-admin@arkaria.postgresql.org; Mon, 18 Mar 2024 14:40:53 +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 1rmEAV-002gPB-3i for pgsql-admin@arkaria.postgresql.org; Mon, 18 Mar 2024 14:40:51 +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 1rmEAU-002gP2-PG for pgsql-admin@lists.postgresql.org; Mon, 18 Mar 2024 14:40:51 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rmEAQ-0059uf-My for pgsql-admin@postgresql.org; Mon, 18 Mar 2024 14:40:50 +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 42IEegG13563774; Mon, 18 Mar 2024 10:40:42 -0400 From: Tom Lane To: Erwin de Haan cc: "pgsql-admin@postgresql.org" Subject: Re: pg_restore with -j > 1 breaks the "clean" phase by not removing dependencies in order In-reply-to: References: Comments: In-reply-to Erwin de Haan message dated "Mon, 18 Mar 2024 09:34:29 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3563772.1710772842.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 18 Mar 2024 10:40:42 -0400 Message-ID: <3563773.1710772842@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Erwin de Haan writes: > I'm having some trouble getting parallel restores to work. When running = pg_restore like this: > pg_restore --no-password --host=3D$MAIN_CLUSTER-pg-cluster --port=3D5432= --dbname=3D$name --jobs=3D4 --format=3Dd --no-owner --clean --if-exists -= -disable-triggers --role=3D${name}_owner "/temp_data/data-$name-$UNIQUE_SU= FFIX" > the restore errors on foreign key constraints while removing tables, is = there anyway to keep this parallel but have it respect the tree of depende= ncies. pg_restore does not parallelize the DROP stage of the process, so I can't help thinking you've misidentified the source of the problem. Can you provide a concrete example that misbehaves? Also, what PG version is this? regards, tom lane