5

Error occured while restoring the PostgreSQL Db

PostgreSQL :- Version : 11 pgAdmin 4

Refer below image

enter image description here

Nam G VU
  • 33,193
  • 69
  • 233
  • 372

1 Answers1

4

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

Nam G VU
  • 33,193
  • 69
  • 233
  • 372
  • That's so wierd, so I want to export my data from a pg 10 to a pg14 instance, but I cannot do so because the pg_dump will always be on ver 10 and my pg_restore on ver 14 – Gaus Aug 24 '22 at 11:33