Postgres Error for OLD version

Postgres

Probuse Admin
Issue:-

ProgrammingError: relation "ir_attachment_id_seq" does not exist while restoring database

Solution:-

Issue was because of different postgres versions on Odoo & Database server. Postgres 9.5 vs 10

 - Apparently there is a single statement that causes this when creating sequences, which is the "AS INTEGER" in every "CREATE SEQUENCE" which is not supported in PostgreSQL 9.6.

To work around this, you need to unzip your backup file, open & edit your dump.sql file and delete every occurrence of "AS INTEGER" from every "CREATE SEQUENCE" statement. Then zip the contents again and try to restore one more time. It will work.

Reference Link: https://github.com/Yenthe666/auto_backup/issues/79