简体   繁体   中英

pg_dump 9.0 to pg_restore 8.3

Is it possible to instruct pg_dump of 9.0 to provide a backward-compatible dump, or force pg_restore of 8.3 to work with that dump?

In other words, what are my options in resolving this error on restoring dump made with 9.0 with pg_restore 8.3:

pg_restore: [archiver] unsupported version (1.12) in file header

What are the possible caveats of this dump/restore version conflict?

Create a plain text dump:

pg_dump mydb > db.sql
psql -d newdb -f db.sql

This should work OK, as it stores no version information, and uses plain SQL format in the dump. The data is restored with COPY so it's fast. If you've used some 9.0 features in the DB, then you'll have to manually edit the schema in the dump to make it work on 8.3. Blobs may not survive this format however; I've not tested that).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM