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 1rfN75-00HFld-NG for pgsql-admin@arkaria.postgresql.org; Wed, 28 Feb 2024 16:49:00 +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 1rfN74-00CHbA-87 for pgsql-admin@arkaria.postgresql.org; Wed, 28 Feb 2024 16:48:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfN73-00CHb2-Tn for pgsql-admin@lists.postgresql.org; Wed, 28 Feb 2024 16:48:58 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfN71-001oTT-UJ for pgsql-admin@lists.postgresql.org; Wed, 28 Feb 2024 16:48:57 +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 41SGmsTk2318661; Wed, 28 Feb 2024 11:48:54 -0500 From: Tom Lane To: David Barron cc: Pgsql-admin Subject: Re: Backup strategy In-reply-to: References: <2317287.1709138280@sss.pgh.pa.us> Comments: In-reply-to David Barron message dated "Wed, 28 Feb 2024 16:45:08 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2318659.1709138934.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 28 Feb 2024 11:48:54 -0500 Message-ID: <2318660.1709138934@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Barron writes: > If, for example, table a has a constraint that references rows in table = b, table b has to be restored first, but pg_dump doesn't take that into ac= count. Yes it does: it doesn't restore foreign key constraints until after all the data is loaded. What I suspect is that by "constraint" you mean some handmade hack like a trigger that looks at other tables. But without details about what you're doing, it's hard to recommend solutions. regards, tom lane