From 7d24d06c71d3abd72c25caaea86305aa46d44a08 Mon Sep 17 00:00:00 2001 From: Yuka Date: Sat, 24 Jul 2021 19:12:08 +0200 Subject: [PATCH] nixos/postgresql: use postgres 13 for 21.11 (#131018) Co-authored-by: Kim Lindberger --- nixos/doc/manual/from_md/release-notes/rl-2111.section.xml | 5 +++++ nixos/doc/manual/release-notes/rl-2111.section.md | 2 ++ nixos/modules/services/databases/postgresql.nix | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml index 3695997f7176..cc3b5cbd29eb 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml @@ -32,6 +32,11 @@ from Python 3.8. + + + PostgreSQL now defaults to major version 13. + +
diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md index cc5b6bf81eec..5c27dba5fe07 100644 --- a/nixos/doc/manual/release-notes/rl-2111.section.md +++ b/nixos/doc/manual/release-notes/rl-2111.section.md @@ -11,6 +11,8 @@ In addition to numerous new and upgraded packages, this release has the followin - `python3` now defaults to Python 3.9, updated from Python 3.8. +- PostgreSQL now defaults to major version 13. + ## New Services {#sec-release-21.11-new-services} - [btrbk](https://digint.ch/btrbk/index.html), a backup tool for btrfs subvolumes, taking advantage of btrfs specific capabilities to create atomic snapshots and transfer them incrementally to your backup locations. Available as [services.btrbk](options.html#opt-services.brtbk.instances). diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix index effc9182472e..fd4a195787f3 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -293,7 +293,8 @@ in # Note: when changing the default, make it conditional on # ‘system.stateVersion’ to maintain compatibility with existing # systems! - mkDefault (if versionAtLeast config.system.stateVersion "20.03" then pkgs.postgresql_11 + mkDefault (if versionAtLeast config.system.stateVersion "21.11" then pkgs.postgresql_13 + else if versionAtLeast config.system.stateVersion "20.03" then pkgs.postgresql_11 else if versionAtLeast config.system.stateVersion "17.09" then pkgs.postgresql_9_6 else throw "postgresql_9_5 was removed, please upgrade your postgresql version.");