pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Campbell, Lance <lance@illinois.edu>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: enhancement request for pg_restore
Date: Thu, 13 Aug 2015 13:37:29 -0400
Message-ID: <19660.1439487449@sss.pgh.pa.us> (raw)
In-Reply-To: <20150813155625.GF8988@awork2.anarazel.de>
References: <B75CD08C73BD3543B97E4EF3964B7D701FFB5FC5@CITESMBX1.ad.uillinois.edu>
	<20150813155625.GF8988@awork2.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Andres Freund <andres@anarazel.de> 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



view thread (3+ messages)

Message-ID: <19660.1439487449@sss.pgh.pa.us>
Permalink:  ../19660.1439487449@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19660.1439487449@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, lance@illinois.edu
  Subject: Re: enhancement request for pg_restore
  In-Reply-To: <19660.1439487449@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox