'pg_restore: [tar archiver] could not find header for file "toc.dat" in tar archive :- [PostgreSQL-11] pg admin 4
Solution 1:[1]
In brief
MUST-HAVE pg_restore version on localhost matched with the pg_dump on machine where the backup is created aka backup-site
In full detail
the context
Postgres db backup by pg_dump and restore by pg_restore ref
pg_restore - We want to restore backupfile, ie the .tar file or untar folder of that .tar file, into a local postgres database localdb
pg_dump - The backupfile is created using this tool
the issue
The pg_restore on our local machine may have version NOT MATCHED vs the pg_dump version, which was used when creating the backup file
solution
Install pg_restore on your machine having the SAME VERSION on both local machine and on backup-site
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nam G VU |

