Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg_dump version incompatibility #30

Open
jannikw opened this issue Jun 1, 2020 · 5 comments
Open

pg_dump version incompatibility #30

jannikw opened this issue Jun 1, 2020 · 5 comments

Comments

@jannikw
Copy link
Contributor

jannikw commented Jun 1, 2020

pg_dump is only backwards compatible not forward compatible. You can connect to and backup postgres databases for which the version is <= to the installed version of pg_dump.
When attempting to backup a newer version the following error is displayed:

pg_dump: server version: 12.3 (Debian 12.3-1.pgdg100+1); pg_dump version: 11.7
pg_dump: aborting because of server version mismatch

Running pg_dump --version with the current docker image shows version 11.7 meaning postgres databases with major version 12 can't be backed up.

@cschmatzler
Copy link

Any update on this?

@einarf
Copy link
Member

einarf commented Aug 23, 2020

hmm. Need to look at how the image is built. Any insight to this is appreciated.

@jannikw
Copy link
Contributor Author

jannikw commented Aug 23, 2020

This is not really fixable by adjusting the image, since you would have to ship every version of pg_dump as it is recommended to create the database dump with the exact version the database is running at. Though the latest version of pg_dump should be able to produce dumps for every previous version (up to some point), it is not guaranteed that these dumps can be restored with an older version, possibly the version the database is actually running at. This would kind of defeat the purpose of a backup if you cannot restore it :D
See https://www.postgresql.org/docs/10/app-pgdump.html:

Because pg_dump is used to transfer data to newer versions of PostgreSQL, the output of pg_dump can be expected to load into PostgreSQL server versions newer than pg_dump's version. pg_dump can also dump from PostgreSQL servers older than its own version. (Currently, servers back to version 8.0 are supported.) However, pg_dump cannot dump from PostgreSQL servers newer than its own major version; it will refuse to even try, rather than risk making an invalid dump. Also, it is not guaranteed that pg_dump's output can be loaded into a server of an older major version — not even if the dump was taken from a server of that version. Loading a dump file into an older server may require manual editing of the dump file to remove syntax not understood by the older server. Use of the --quote-all-identifiers option is recommended in cross-version cases, as it can prevent problems arising from varying reserved-word lists in different PostgreSQL versions.

@einarf
Copy link
Member

einarf commented Aug 23, 2020

So maybe the solution is to run pg_dump in the database container itself like suggested in #29

@wehrstedt
Copy link

So maybe the solution is to run pg_dump in the database container itself like suggested in #29

@einarf Is there any progress on this? Trying to use rcb with postgres 13.6. The suggestion in #29 seems to be a good solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants