Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

393
Views
Error when restoring 9.5 pgdump files on 9.6 postgres

We have been using 9.5 postgres.

And we use pgdump to get backup files from that database and then subsequently use it to restore on a 9.6 postgres.

We were unable to restore successfully. Usually the minor version upgrade does not mean backwards breaking.

I am wondering what's the issue causing us to be unable to successfully restore on a 9.6 database.

We need to do so just in case we need to restore from archived data backups.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I was facing the same error when upgrading from 9.3 to 9.6. The restore failed every time I tried but the dump was successful.

My solution to this problem was not to use the custom format! Instead I used the plain format. So I tried plain format with file extension sql, with utf8 encoding as user postgres. And obviously don't forget to include pre-data, data and post-data because otherwise your restore won't be complete. This works perfectly.

If your dump is ok, also try a full vacuum before the dump. If the vacuum is not ok, this might be your problem.

over 4 years ago · Santiago Trujillo Report

0

To Take Dump

pg_dump --username=postgres --format=c --file=e:/testdbdump.sql testdb 

OR

pg_dump -U username databasename >>sqlfile.sql

To Restore

pg_restore --username=postgres --dbname=testdb<d:\sqlfile.sql

pg_restore --username=postgres --dbname=testdb <d:\sqlfile.sql



pg_restore --username=postgres --dbname=testdb <d:\testDBApr18.sql

pg_restore --username=postgres --dbname=testdb <c:\Backup\testdbDBApr18.sql

// PG DUMP & RESTORE THAT WORKS FOR ME

pg_dump -U postgres -h localhost --format=c testdb > db_dump_file.dump

pg_restore -U postgres -h localhost -v -d testdb db_dump_file.dump
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!