backup/backup

toc.dat is not being packed in the postgres tarball

Talha345 opened this issue · 1 comments

When I'm trying to restore a postgresql database with a dump file in a .tar format I get a pg_restore: [tar archiver] could not find header for file "toc.dat" in tar archive. Upon inspecting the tar file with tar -tvf db_tarball.tar the list of files does not include the file "toc.dat". I believe that this prevents me from performing a pg_restore.

How to replicate?
1.gem install backup
2.generate backup config and model
3.trigger a backup perfrom
pg_restore -c -U username -d database -v "/path/to/file"
Run into the "toc.dat" not found error
This is how the database block looks like

db.username           = ENV["POSTGRESQL_USERNAME"]
db.password           = ENV["POSTGRESQL_PASSWORD"]
db.host               = ENV["api_host"]
db.port               = 5432
db.additional_options = ["-xc", "-E=utf8"]```

My config file is the out-of-the-box everything commented file.

  • Operating system: Ubuntu 20.02
  • Ruby version: 2.5.1
  • Tools or services used by backup: PostgreSQL 12.2

This is due to the reason that the DB dump was stored in a plain text .sql file and cannot be restored using pg_restore.