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