enhancement request for pg_restore - Mailing list pgsql-admin

From Campbell, Lance
Subject enhancement request for pg_restore
Date
Msg-id B75CD08C73BD3543B97E4EF3964B7D701FFB5FC5@CITESMBX1.ad.uillinois.edu
Whole thread Raw
Responses Re: enhancement request for pg_restore  (Andres Freund <andres@anarazel.de>)
List pgsql-admin
PostgreSQL 9.4.x

I love using the PostgreSQL database.  It is wonderful.

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.
Butthere are many times when you have some tables that hold data you don't necessarily need information from.  In those
casesI would exclude those tables.  I would then do a second pg_restore so I could get the schema for those particular
tables.

Example of how this would work:

pg_restore -U someuser -h localhost -d mydatabase --schema=myschema  --exclude-table=myschema.table1
--exclude-table=myschema.table2--format=custom  /my/backup/to/restore 

pg_restore -U someuser -h localhost -d mydatabase --schema-only  -- table=myschema.table1  --table=myschema.table2
--format=custom /my/backup/to/restore 

Thanks for considering this enhancement to pg_restore.

Lance Campbell
Web Services
University of Illinois




pgsql-admin by date:

Previous
From: Prasanth Reddy
Date:
Subject: Re: Postgresql 9.4.4 - ERROR: invalid byte sequence for encoding "UTF8": 0x92
Next
From: Andres Freund
Date:
Subject: Re: enhancement request for pg_restore