From 53b8d04ebc10d070b7efafd6dfa9de2897916888 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 15:35:12 +0200 Subject: Adding upstream version 258. Signed-off-by: Daniel Baumann --- pg_upgradecluster.d/analyze | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 pg_upgradecluster.d/analyze (limited to 'pg_upgradecluster.d') diff --git a/pg_upgradecluster.d/analyze b/pg_upgradecluster.d/analyze new file mode 100755 index 0000000..f410365 --- /dev/null +++ b/pg_upgradecluster.d/analyze @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Run ANALYZE on all databases in the upgraded cluster + +set -eu + +oldversion="$1" +cluster="$2" +newversion="$3" +phase="$4" + +case $newversion in + 9.2|9.3) + analyze="--analyze-only" + ;; + *) + analyze="--analyze-in-stages" + ;; +esac + +case $newversion in + 9.5|9.6|[1-7]*) + [ "${PGJOBS:-}" ] && jobs="--jobs=$PGJOBS" + ;; +esac + +case $phase in + finish) + vacuumdb --cluster "$newversion/$cluster" --all $analyze ${jobs:-} + ;; +esac + +exit 0 -- cgit v1.2.3