Skip to content
Advertisement

How to restore postgres 12 generated sql file into postgres 9.6 database

I am trying to restore the database. The database sql file is about 4.5 GB so I couldn’t edit it on editor. I dump the database using following command in postgres 12;

But I need the same database in postgres 9.6. For this purpose, I write the following code to restore it

It shows the error like this (Error in creating sequence). But this is not the duplicated one with given question. error message;

I saw the answer of this question. The answer already said the sql file will not work on older version. But I want to know, Is there any way to restore using this sql file?

Advertisement

Answer

Thank you @jjanes and @JGH for your kind cooperation. I found the one solution. First I backup the database using following command;

Then I create earthquake database manually from the pgadmin 4. After getting the backup.gz file, I restore it using following command in terminal;

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement