diff --git a/nixos/doc/manual/administration/declarative-containers.section.md b/nixos/doc/manual/administration/declarative-containers.section.md index 273672fc10ca..0d9d4017ed81 100644 --- a/nixos/doc/manual/administration/declarative-containers.section.md +++ b/nixos/doc/manual/administration/declarative-containers.section.md @@ -9,7 +9,7 @@ containers.database = { config = { config, pkgs, ... }: { services.postgresql.enable = true; - services.postgresql.package = pkgs.postgresql_9_6; + services.postgresql.package = pkgs.postgresql_10; }; }; ``` diff --git a/nixos/doc/manual/from_md/administration/declarative-containers.section.xml b/nixos/doc/manual/from_md/administration/declarative-containers.section.xml index a918314a2723..7b35520d567b 100644 --- a/nixos/doc/manual/from_md/administration/declarative-containers.section.xml +++ b/nixos/doc/manual/from_md/administration/declarative-containers.section.xml @@ -11,7 +11,7 @@ containers.database = { config = { config, pkgs, ... }: { services.postgresql.enable = true; - services.postgresql.package = pkgs.postgresql_9_6; + services.postgresql.package = pkgs.postgresql_10; }; }; diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix index d49cb4c51a72..2919022496a3 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -289,14 +289,16 @@ in port = cfg.port; }; - services.postgresql.package = + services.postgresql.package = let + mkThrow = ver: throw "postgresql_${ver} was removed, please upgrade your postgresql version."; + in # Note: when changing the default, make it conditional on # ‘system.stateVersion’ to maintain compatibility with existing # systems! 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."); + else if versionAtLeast config.system.stateVersion "17.09" then mkThrow "9_6" + else mkThrow "9_5"); services.postgresql.dataDir = mkDefault "/var/lib/postgresql/${cfg.package.psqlSchema}"; diff --git a/nixos/modules/virtualisation/nixos-containers.nix b/nixos/modules/virtualisation/nixos-containers.nix index 279c96567353..0838a57f0f37 100644 --- a/nixos/modules/virtualisation/nixos-containers.nix +++ b/nixos/modules/virtualisation/nixos-containers.nix @@ -716,9 +716,9 @@ in { config = { config, pkgs, ... }: { services.postgresql.enable = true; - services.postgresql.package = pkgs.postgresql_9_6; + services.postgresql.package = pkgs.postgresql_10; - system.stateVersion = "17.03"; + system.stateVersion = "21.05"; }; }; } diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix index 5b0190b93ac5..0af47ccca83a 100644 --- a/pkgs/servers/sql/postgresql/default.nix +++ b/pkgs/servers/sql/postgresql/default.nix @@ -201,15 +201,6 @@ let in self: { - postgresql_9_6 = self.callPackage generic { - version = "9.6.24"; - psqlSchema = "9.6"; - sha256 = "sha256-rrehlr4+vtGnR271ZfOXIhh8EI3UfadIm+nE/K6YKs4="; - this = self.postgresql_9_6; - thisAttr = "postgresql_9_6"; - inherit self; - }; - postgresql_10 = self.callPackage generic { version = "10.19"; psqlSchema = "10.0"; # should be 10, but changing it is invasive diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index cd800708ba30..cf33d0c52f2c 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -721,6 +721,7 @@ mapAliases ({ polarssl = mbedtls; # added 2018-04-25 poppler_qt5 = libsForQt5.poppler; # added 2015-12-19 postgresql96 = postgresql_9_6; + postgresql_9_6 = throw "postgresql_9_6 has been removed from nixpkgs, as this version is no longer supported by upstream"; # added 2021-12-03 # postgresql plugins pgjwt = postgresqlPackages.pgjwt; pg_repack = postgresqlPackages.pg_repack; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7655339b5813..82d6b32b949e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21359,7 +21359,6 @@ with pkgs; timescaledb-tune = callPackage ../development/tools/database/timescaledb-tune { }; inherit (import ../servers/sql/postgresql pkgs) - postgresql_9_6 postgresql_10 postgresql_11 postgresql_12