Postgres Error for OLD version


Probuse Admin

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


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: