Recovery of a dropped/damaged table
You may drop or even damage a table in some way. Tables could be damaged for physical reasons, such as disk corruption, or they could also be damaged by running poorly specified
DELETE commands, which update too many rows or overwrite critical data.
Recovering from this backup situation is a common request.
How to do it…
The methods to this approach differ, depending on the type of backup you have available. If you have multiple types of backup, you have a choice.
Logical – from the custom dump taken with pg_dump -F c
pg_restore -t mydroppedtable dumpfile | psql
Alternatively, you can directly connect to the database using
-d. If you use this option, then you can allow multiple jobs in parallel...