django-pg-copy icon indicating copy to clipboard operation
django-pg-copy copied to clipboard

best practice: "pg_dump: error: aborting because of server version mismatch"

Open sebastian-philipp opened this issue 1 year ago • 2 comments

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?

sebastian-philipp avatar Apr 21 '23 15:04 sebastian-philipp

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 to stage, 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?

FlipperPA avatar Apr 24 '23 20:04 FlipperPA

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.

sebastian-philipp avatar Apr 25 '23 07:04 sebastian-philipp