From f6c476a07f2e7d1e8671cfe01a749d7ca5a0e4a2 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 7 May 2024 11:20:40 +0000 Subject: [PATCH] nixos: services: postgres: add post-upgrade advice --- modules/nixos/services/postgresql/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/nixos/services/postgresql/default.nix b/modules/nixos/services/postgresql/default.nix index 7559bb6..bbe46d4 100644 --- a/modules/nixos/services/postgresql/default.nix +++ b/modules/nixos/services/postgresql/default.nix @@ -58,6 +58,13 @@ in --old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \ --old-bindir "$OLDBIN" --new-bindir "$NEWBIN" \ "$@" + + cat << EOF + Run the following commands after setting: + services.postgresql.package = pkgs.postgresql_${lib.versions.major newPackage.version} + sudo -u postgres vacuumdb --all --analyze-in-stages + ${newData}/delete_old_cluster.sh + EOF '') ]; })