django-pg-copy
django-pg-copy copied to clipboard
best practice: "pg_dump: error: aborting because of server version mismatch"
pg_dump: error: server version: x; pg_dump version: y
pg_dump: error: aborting because of server version mismatch
How d you folks deal with this? Do you always keep prod and staging on the same db version? Do you have a hard dependency between the django version and the postgres version?
Hey @sebastian-philipp, we haven't run into this, because as you noted, our use case keeps us on PostgreSQL versions.
In our environment, we have dev
/ stage
/ prod
, and the typical use cases are these:
- a developer triggers a backup of
production
, copies the file / directory to local dev, and restores - a Jenkins job backs up
prod
, transfers the backup tostage
, and restores as part of our stage publishing process. This allows us to do things like repeated tests on migrations.
Is this error being triggered when you're backing up on an older version of PostgreSQL and restoring on a newer on, vice versa, or both?
Right, turns out that, unfortunately, we don't have both versions (client and server) completely under our control. And at this time I'm a bit hesitant to put in the effort of forking an upstream container image, as that would be just for pg_dump at this time.