0

I took a backup of the Postgres database version 15, and now I want to restore that data to Postgres version 13.1.2? is it possible?

asked Sep 18, 2023 at 16:02
1
  • What command line did you use? Commented Sep 19, 2023 at 14:49

1 Answer 1

1

It is not supported to downgrade PostgreSQL, no matter what.

The only way to success is the following cumbersome route:

  • Take a plain-format dump with

    pg_dump -f dump.sql dbname
    

    You need to use pg_dump from version 15 for that

  • Try to restore the dump to version 13 using psql. That will fail. Look at the error messages and edit dump.sql, manually changing the SQL syntax to avoid the error. Then try to restore again, and so on until all errors are gone.

I hope 13.1.2 is a typo, and you mean 13.12.

answered Sep 19, 2023 at 19:15
1
  • Thanks! Yes, 13.1.2 was indeed a typo Commented Sep 21, 2023 at 12:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.