简体   繁体   中英

How to downgrade a postgres database from version 10 to 9.1?

I have a system that only supports version 9.1 of postgres and a client (company) has been managing their data with version 10. There are many tables and I need to know if there is a script to downgrade the database from version 10 to 9.1. Thanks in advance!

As other commenters have already stated, PostgreSQL 9.1 is long obsolete, and this is a bad idea in general. However, to answer your question, you would have to dump the data with pg_dump into plain SQL statements using the latest pg_dump utility from PG 10.

pg_dump --column-inserts

which will produce a plain text file that can be restored back to 9.1 using the psql utility from 9.1. It will be super slow and painful, as it should be when you are going in the decidedly wrong direction. A better answer would be to figure out why 9.1 is necessary, as @adrian.klaver mentions.

Yes, @AdrianKlaver is correct. Any new features will break the transfer.

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