stash.diy-backup.postgresql.sh function stash_restore_db fails with PostgreSQL 8.4

XMLWordPrintable

    • Severity 2 - Major

      Hi,

      I am verifying my diy backups to make sure I can restore but it's not working for me.

      The postscript function stash_backup_db uses format option '-Fd'
      pg_dump ${PG_USER} ${PG_HOST} --port=${POSTGRES_PORT} ${PG_PARALLELL} -Fd ${STASH_DB} ${PG_SNAPSHOT_OPT} -f ${STASH_BACKUP_DB}

      and the pg_restore_db uses the same thing. But when I tried to restore I got a failure:
      pg_restore: unrecognized archive format "d"; please specify "c" or "t"

      Looking at the man pages (I have postgresql 8.4) neither pg_dump or pg_restore have "d" listed as a valid format option. pg_dump lists p,c,t and pg_restore only lists c and t. I tried to restore using '-Ft' and the error became :
      pg_restore: [tar archiver] could not find header for file toc.dat in tar archive

      So I then tried '-Fc' and the error became
      pg_restore: [archiver] unexpected end of file

      So then I tried leaving out the -F argument altogether and the error became
      pg_restore: [archiver] could not read input file: Is a directory

      I checked the latest stash-diy-backup-postgresql code and the functions look unchanged from what I have.

      I am worried that my backups are all invalid. Is there a way to restore one of them?

      Which format should I use going forward?

      Thanks
      Mark

            Assignee:
            Unassigned
            Reporter:
            mark.ruedy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: