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 1lrWPD-0003cs-VK for pgsql-admin@arkaria.postgresql.org; Fri, 11 Jun 2021 01:56:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lrWPC-0002Nd-Hh for pgsql-admin@arkaria.postgresql.org; Fri, 11 Jun 2021 01:56:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrWPC-0002NN-9S for pgsql-admin@lists.postgresql.org; Fri, 11 Jun 2021 01:56:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrWPA-0004Yh-D6 for pgsql-admin@postgresql.org; Fri, 11 Jun 2021 01:56:17 +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 15B1uFO31832920; Thu, 10 Jun 2021 21:56:15 -0400 From: Tom Lane To: Wells Oliver cc: pgsql-admin Subject: Re: pg_dump directory format and proper ordering In-reply-to: References: Comments: In-reply-to Wells Oliver message dated "Thu, 10 Jun 2021 18:32:03 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1832918.1623376575.1@sss.pgh.pa.us> Date: Thu, 10 Jun 2021 21:56:15 -0400 Message-ID: <1832919.1623376575@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Wells Oliver writes: > Hi: I wanted to check on something: if I pg_dump four schemas in directory > format with a selection of schemas, and then pg_restore, I'm assuming psql > will know the order of priority for restoration, meaning it will restore > schema A first if schema B/C/D depend on those entities, right? It tracks dependencies at the per-object level. I'm not aware of any way that a schema as such could depend on another, but it should take care of correct restoration order for the objects within them. regards, tom lane