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 1tuw32-00EZb0-Qt for pgsql-general@arkaria.postgresql.org; Wed, 19 Mar 2025 16:13:40 +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 1tuw31-007Kez-8E for pgsql-general@arkaria.postgresql.org; Wed, 19 Mar 2025 16:13:39 +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 1tuw30-007Ker-TV for pgsql-general@lists.postgresql.org; Wed, 19 Mar 2025 16:13:38 +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.96) (envelope-from ) id 1tuw2x-003mzV-18 for pgsql-general@lists.postgresql.org; Wed, 19 Mar 2025 16:13:38 +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 52JGDQrw710894; Wed, 19 Mar 2025 12:13:27 -0400 From: Tom Lane To: Sylvain Cuaz cc: pgsql-general@lists.postgresql.org Subject: Re: Restoring only a subset of schemas In-reply-to: <238e8c2a-b202-41b4-92e9-c0dbc4700c26@ilm-informatique.fr> References: <7d869dac-5fe0-488c-a7a1-436b1d939057@ilm-informatique.fr> <4009720.1742225376@sss.pgh.pa.us> <238e8c2a-b202-41b4-92e9-c0dbc4700c26@ilm-informatique.fr> Comments: In-reply-to Sylvain Cuaz message dated "Wed, 19 Mar 2025 09:24:05 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <710892.1742400806.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 19 Mar 2025 12:13:26 -0400 Message-ID: <710893.1742400806@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Sylvain Cuaz writes: > Further, I don't see how it's an edge-case, at the core I just want to r= estore some but not all the = > schemas. This is possible for pg_dump, see my response to Adrian Klaver. You have a very good point that it's annoying that pg_restore's --schema switch doesn't act like pg_dump's --schema switch. I could support changing that, but only if we also did something about the fact that pg_restore's switch doesn't handle patterns. The pattern aspect is kind of a mess, because pg_dump implements that through a server-side regex, which is a facility pg_restore doesn't have access to. Maybe it'd be good enough to implement the "*" and "?" wildcards and stop there, but I'm not sure. regards, tom lane