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 1ovJcZ-0002tT-M3 for pgsql-general@arkaria.postgresql.org; Wed, 16 Nov 2022 14:42:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ovJcY-0000Ck-Hh for pgsql-general@arkaria.postgresql.org; Wed, 16 Nov 2022 14:42:34 +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 1ovJcY-0000CX-7I for pgsql-general@lists.postgresql.org; Wed, 16 Nov 2022 14:42:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovJcW-0005eL-7Y for pgsql-general@lists.postgresql.org; Wed, 16 Nov 2022 14:42:33 +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 2AGEgSts1340309; Wed, 16 Nov 2022 09:42:28 -0500 From: Tom Lane To: Guillaume Lelarge cc: Fabrice Chapuis , "pgsql-generallists.postgresql.org" , Marcos Pegoraro Subject: Re: pg_restore remap schema In-reply-to: References: <645026.1659982962@sss.pgh.pa.us> Comments: In-reply-to Guillaume Lelarge message dated "Wed, 16 Nov 2022 14:36:15 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1340307.1668609748.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 16 Nov 2022 09:42:28 -0500 Message-ID: <1340308.1668609748@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Guillaume Lelarge writes: > Le mer. 16 nov. 2022 à 13:08, Fabrice Chapuis a > écrit : >> I worked on the pg_dump source code to add remap schema functionality to >> use it internally where I work. This is a first version that allows to >> remap tables, views and sequences (only to export schema). Is this >> development likely to interest the PG community and to continue this >> development further? > If it doesn't work on functions, that will be a big issue. And to be > honest, I don't think you can do it reliably on functions, especially with > dynamic queries in PL/pgsql. Yeah --- I fear there is no hope of making a feature like this that works reliably enough that we'd accept it. pg_restore is just not that smart about what is in the chunks of DDL that it processes, and trying to make it smart enough is a losing game. regards, tom lane