Re: enhancement request for pg_restore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: "Campbell, Lance" <lance(at)illinois(dot)edu>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: enhancement request for pg_restore
Date: 2015-08-13 17:37:29
Message-ID: 19660.1439487449@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Andres Freund <andres(at)anarazel(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Adam FUCHS 2015-08-14 19:17:55 postgres_fdw error
Previous Message Andres Freund 2015-08-13 15:56:25 Re: enhancement request for pg_restore