Re: enhancement request for pg_restore - Mailing list pgsql-admin

From Andres Freund
Subject Re: enhancement request for pg_restore
Date
Msg-id 20150813155625.GF8988@awork2.anarazel.de
Whole thread Raw
In response to enhancement request for pg_restore  ("Campbell, Lance" <lance@illinois.edu>)
Responses Re: enhancement request for pg_restore
List pgsql-admin
Hi Lance,

On 2015-08-13 15:10:21 +0000, Campbell, Lance wrote:
> PostgreSQL 9.4.x
>
> I love using the PostgreSQL database.  It is wonderful.

Good to hear!

> Please consider adding to pg_restore the command line option to exclude one or more tables similar to the pg_dump
option.
>
> Example:
>
> --exclude-table=table
>
> Why?  I like to restore all tables within a particular namespace from
> our production database to our test database.  But there are many
> times when you have some tables that hold data you don't necessarily
> need information from.  In those cases I would exclude those tables.
> I would then do a second pg_restore so I could get the schema for
> those particular tables.

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.

Greetings,

Andres Freund


pgsql-admin by date:

Previous
From: "Campbell, Lance"
Date:
Subject: enhancement request for pg_restore
Next
From: Tom Lane
Date:
Subject: Re: enhancement request for pg_restore