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

postgres tools should match server version #1

Open
ipmb opened this issue Jan 4, 2025 · 0 comments · May be fixed by #2
Open

postgres tools should match server version #1

ipmb opened this issue Jan 4, 2025 · 0 comments · May be fixed by #2
Assignees

Comments

@ipmb
Copy link
Member

ipmb commented Jan 4, 2025

pg_restore and pg_dump can cause issues when there is a version mismatch between server and client.

Update the image to include all versions of the client tools from 11-17 and use something like psql -c "SELECT version()" (should be safe to use the latest client) and then use the matching tooling for the version provided for all other commands.

https://www.postgresql.org/docs/17/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 9.2 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.

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