Andreas Vöst
26 days
Claus-Theodor Riegg
4 years
Andreas Vöst
2 months
Andreas Vöst
2 months
Kim Klotz
3 months
Claus-Theodor Riegg
8 years
Andreas Vöst
5 months
Andreas Vöst
7 months
Claus-Theodor Riegg
8 years
Marc Dierig
9 months
Claus-Theodor Riegg
7 years

Restoring old Postgres dumps with pg_restore v11 and higher

Updated . Posted . Visible to the public. Repeats.

There is an issue with when restoring a PostgreSQL dump created with pg_dump < v11 with pg_restore > v10:

pg_restore: [archiver (db)] could not execute query: ERROR:  schema "public"
already exists
    Command was: CREATE SCHEMA public;

Convert

If you want to restore this dump you should convert the dump to the text format first and comment out the CREATE SCHEMA public; statement. For further information see linked content.

Use different pg_restore

After adding the PostgreSQL APT respository Show archive.org snapshot you can install additional client versions on your local machine with apt install postgresql-client-$VERSION. You'll find them here: /usr/lib/postgresql/$VERSION/bin/pg_restore.


Also see our card on importing Postgres dumps created with newer versions.

Claus-Theodor Riegg
Last edit
Marius Schuller
License
Source code in this card is licensed under the MIT License.