From 26696aaa53a5b17fba9456bbc3f46b7d2bf9c110 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Wed, 1 Feb 2023 17:43:23 +0000 Subject: [PATCH] upgrade-postgresql: Also upgrade postgresql-client. The `pg_upgrade` tool uses `pg_dump` as an internal step, and verifies that the version of `pg_upgrade` is the same exactly the same as the version of the PostgreSQL server it is upgrading to. A mismatch (even in packaging versions) leads to it aborting: ``` /usr/lib/postgresql/14/bin/pg_upgrade -b /usr/lib/postgresql/13/bin -B /usr/lib/postgresql/14/bin -p 5432 -P 5435 -d /etc/postgresql/13/main -D /etc/postgresql/14/main --link Finding the real data directory for the source cluster ok Finding the real data directory for the target cluster ok check for "/usr/lib/postgresql/14/bin/pg_dump" failed: incorrect version: found "pg_dump (PostgreSQL) 14.6 (Ubuntu 14.6-0ubuntu0.22.04.1)", expected "pg_dump (PostgreSQL) 14.6 (Ubuntu 14.6-1.pgdg22.04+1)" Failure, exiting ``` Explicitly upgrade `postgresql-client` at the same time we upgrade `postgresql` itself, so their versions match. Fixes: #24192 --- scripts/setup/upgrade-postgresql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup/upgrade-postgresql b/scripts/setup/upgrade-postgresql index daed4ee5e7..1bf36f87bd 100755 --- a/scripts/setup/upgrade-postgresql +++ b/scripts/setup/upgrade-postgresql @@ -24,7 +24,7 @@ fi set -x "$ZULIP_PATH"/scripts/lib/setup-apt-repo -apt-get install -y "postgresql-$UPGRADE_TO" +apt-get install -y "postgresql-$UPGRADE_TO" "postgresql-client-$UPGRADE_TO" if pg_lsclusters -h | grep -qE "^$UPGRADE_TO\s+main\b"; then pg_dropcluster "$UPGRADE_TO" main --stop fi