I would like to restore selected (currently after -t) tables including all indexes without making a definition after -I - because indexes are changing, new ones are created, old ones may expire. What is the best way to perform the restore process in Postresql db? I have read that is possible to restore whole db, and then delete unnecessary tabels. I'm afraid that the process will be much longer and will load the database too much.

-t - recreates only data
-I - I have to define index by myself, I want it to happen automatically

1 Answer 1


I think the easiest way to do that is on the dump side. With pg_dump, -t will dump the index definitions along with the table, while on the pg_restore side, -t won't include the indexes.

If you can't use -t on the pg_dump side of things, then I think you will need to script up something using the -l and -L flags to pg_restore.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.