Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

390
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda