Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZPwRr-0006tX-OT for pgsql-admin@arkaria.postgresql.org; Thu, 13 Aug 2015 17:37:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZPwRr-0000rr-5I for pgsql-admin@arkaria.postgresql.org; Thu, 13 Aug 2015 17:37:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZPwRp-0000rh-NI for pgsql-admin@postgresql.org; Thu, 13 Aug 2015 17:37:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZPwRm-0002MA-Cr for pgsql-admin@postgresql.org; Thu, 13 Aug 2015 17:37:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t7DHbTBr019661; Thu, 13 Aug 2015 13:37:29 -0400 From: Tom Lane To: Andres Freund cc: "Campbell, Lance" , "pgsql-admin@postgresql.org" Subject: Re: enhancement request for pg_restore In-reply-to: <20150813155625.GF8988@awork2.anarazel.de> References: <20150813155625.GF8988@awork2.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 13 Aug 2015 17:56:25 +0200" Date: Thu, 13 Aug 2015 13:37:29 -0400 Message-ID: <19660.1439487449@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Andres Freund writes: > On 2015-08-13 15:10:21 +0000, Campbell, Lance wrote: >> Please consider adding to pg_restore the command line option to exclude one or more tables similar to the pg_dump option. > You can kind of do this today using pg_restore's --list parameter to > dump the list of objects in the archive, then remove the objects you > don't need/want, and then use --use-list to restore only the remaining > objects. IIRC, the key reason why this is less than trivial is that pg_dump relies on the server to identify which table names match the supplied pattern(s); it basically does a "select from pg_class where relname ~ 'pattern'" kind of query. Short of porting the server's regex engine into pg_restore, it would be hard to be 100% compatible with that definition. Perhaps it's not necessary to implement wildcards in the pg_restore case, or maybe it would be Close Enough if we relied on libc regexes, but in any case it's not quite as simple as it might sound. So basically this is unlikely to happen until somebody who wants the feature bad enough spends the time to write and defend a patch. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin