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 1ovK3X-0004PR-6h for pgsql-general@arkaria.postgresql.org; Wed, 16 Nov 2022 15:10:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ovK3W-00008u-2t for pgsql-general@arkaria.postgresql.org; Wed, 16 Nov 2022 15:10:26 +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 1ovK3V-00008l-PD for pgsql-general@lists.postgresql.org; Wed, 16 Nov 2022 15:10:25 +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 1ovK3T-0004Il-Jg for pgsql-general@lists.postgresql.org; Wed, 16 Nov 2022 15:10:24 +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 2AGFAKVt1343020; Wed, 16 Nov 2022 10:10:20 -0500 From: Tom Lane To: =?UTF-8?Q?St=C3=A9phane_Tachoires?= cc: Guillaume Lelarge , Fabrice Chapuis , "pgsql-generallists.postgresql.org" , Marcos Pegoraro Subject: Re: pg_restore remap schema In-reply-to: References: <645026.1659982962@sss.pgh.pa.us> <1340308.1668609748@sss.pgh.pa.us> Comments: In-reply-to =?UTF-8?Q?St=C3=A9phane_Tachoires?= message dated "Wed, 16 Nov 2022 15:58:29 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1343018.1668611420.1@sss.pgh.pa.us> Date: Wed, 16 Nov 2022 10:10:20 -0500 Message-ID: <1343019.1668611420@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?UTF-8?Q?St=C3=A9phane_Tachoires?= writes: > And could it be at pg_dump level ? > It seems more aware of what is doing... pg_dump would be in a slightly better position, but only slightly. It still has no idea about the contents of function bodies. Also, if it's acceptable to do this at dump time, you could just temporarily rename the schema on the server while making the dump. (Not that that would fix function bodies either.) regards, tom lane