Recovering a complete tablespace is also sometimes required. It's actually a lot easier than recovering a single table.
The methods differ depending upon the type of backup you have available. If you have multiple types of backup, you have a choice.
LOGICAL (from custom dump
If you've taken a logical backup using
pg_dump into a custom file, then you can simply extract the tables you want from the dumpfile, like the following:
pg_restore -t mytab1 -t mytab2 … dumpfile | psql
or connect direct to the database using
Of course, you may have difficulty remembering which exact tables were there. So, you may need to proceed, like the following: