Skip to content

Commit

Permalink
postgresql_11: remove
Browse files Browse the repository at this point in the history
As described in the release lifecycle docs from postgresql[1], v11 will
stop receiving fixes as of Nov 9 2023. This means it's EOL throughout
the entire lifetime of 23.11, so let's drop it now.

A lot of examples are also referencing postgresql_11. Where it's
sensible, use postgresql_15 as example now to avoid confusion.

This is also handy because the LLVM 16 fix for postgresql is not
available for postgresql 11 ;-)

[1] https://www.postgresql.org/support/versioning/
  • Loading branch information
Ma27 committed Oct 30, 2023
1 parent f545851 commit 1220a4d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 40 deletions.
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2311.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ The module update takes care of the new config syntax and the data itself (user

If you use this feature, updates to CoreDNS may require updating `vendorHash` by following these steps again.

- `postgresql_11` has been removed since it'll stop receiving fixes on November 9 2023.

- `ffmpeg` default upgraded from `ffmpeg_5` to `ffmpeg_6`.

- `fusuma` now enables the following plugins: [appmatcher](https://github.com/iberianpig/fusuma-plugin-appmatcher), [keypress](https://github.com/iberianpig/fusuma-plugin-keypress), [sendkey](https://github.com/iberianpig/fusuma-plugin-sendkey), [tap](https://github.com/iberianpig/fusuma-plugin-tap) and [wmctrl](https://github.com/iberianpig/fusuma-plugin-wmctrl).
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/backup/postgresql-wal-receiver.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
options = {
postgresqlPackage = mkOption {
type = types.package;
example = literalExpression "pkgs.postgresql_11";
example = literalExpression "pkgs.postgresql_15";
description = lib.mdDoc ''
PostgreSQL package to use.
'';
Expand Down Expand Up @@ -124,7 +124,7 @@ in {
example = literalExpression ''
{
main = {
postgresqlPackage = pkgs.postgresql_11;
postgresqlPackage = pkgs.postgresql_15;
directory = /mnt/pg_wal/main/;
slot = "main_wal_receiver";
connection = "postgresql://user@somehost";
Expand Down
32 changes: 16 additions & 16 deletions nixos/modules/services/databases/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ PostgreSQL is an advanced, free relational database.
To enable PostgreSQL, add the following to your {file}`configuration.nix`:
```
services.postgresql.enable = true;
services.postgresql.package = pkgs.postgresql_11;
services.postgresql.package = pkgs.postgresql_15;
```
Note that you are required to specify the desired version of PostgreSQL (e.g. `pkgs.postgresql_11`). Since upgrading your PostgreSQL version requires a database dump and reload (see below), NixOS cannot provide a default value for [](#opt-services.postgresql.package) such as the most recent release of PostgreSQL.
Note that you are required to specify the desired version of PostgreSQL (e.g. `pkgs.postgresql_15`). Since upgrading your PostgreSQL version requires a database dump and reload (see below), NixOS cannot provide a default value for [](#opt-services.postgresql.package) such as the most recent release of PostgreSQL.

<!--
After running {command}`nixos-rebuild`, you can verify
Expand Down Expand Up @@ -119,27 +119,27 @@ A complete list of options for the PostgreSQL module may be found [here](#opt-se
## Plugins {#module-services-postgres-plugins}
Plugins collection for each PostgreSQL version can be accessed with `.pkgs`. For example, for `pkgs.postgresql_11` package, its plugin collection is accessed by `pkgs.postgresql_11.pkgs`:
Plugins collection for each PostgreSQL version can be accessed with `.pkgs`. For example, for `pkgs.postgresql_15` package, its plugin collection is accessed by `pkgs.postgresql_15.pkgs`:
```ShellSession
$ nix repl '<nixpkgs>'
Loading '<nixpkgs>'...
Added 10574 variables.
nix-repl> postgresql_11.pkgs.<TAB><TAB>
postgresql_11.pkgs.cstore_fdw postgresql_11.pkgs.pg_repack
postgresql_11.pkgs.pg_auto_failover postgresql_11.pkgs.pg_safeupdate
postgresql_11.pkgs.pg_bigm postgresql_11.pkgs.pg_similarity
postgresql_11.pkgs.pg_cron postgresql_11.pkgs.pg_topn
postgresql_11.pkgs.pg_hll postgresql_11.pkgs.pgjwt
postgresql_11.pkgs.pg_partman postgresql_11.pkgs.pgroonga
nix-repl> postgresql_15.pkgs.<TAB><TAB>
postgresql_15.pkgs.cstore_fdw postgresql_15.pkgs.pg_repack
postgresql_15.pkgs.pg_auto_failover postgresql_15.pkgs.pg_safeupdate
postgresql_15.pkgs.pg_bigm postgresql_15.pkgs.pg_similarity
postgresql_15.pkgs.pg_cron postgresql_15.pkgs.pg_topn
postgresql_15.pkgs.pg_hll postgresql_15.pkgs.pgjwt
postgresql_15.pkgs.pg_partman postgresql_15.pkgs.pgroonga
...
```

To add plugins via NixOS configuration, set `services.postgresql.extraPlugins`:
```
services.postgresql.package = pkgs.postgresql_11;
services.postgresql.extraPlugins = with pkgs.postgresql_11.pkgs; [
services.postgresql.package = pkgs.postgresql_12;
services.postgresql.extraPlugins = with pkgs.postgresql_12.pkgs; [
pg_repack
postgis
];
Expand All @@ -148,7 +148,7 @@ services.postgresql.extraPlugins = with pkgs.postgresql_11.pkgs; [
You can build custom PostgreSQL-with-plugins (to be used outside of NixOS) using function `.withPackages`. For example, creating a custom PostgreSQL package in an overlay can look like:
```
self: super: {
postgresql_custom = self.postgresql_11.withPackages (ps: [
postgresql_custom = self.postgresql_12.withPackages (ps: [
ps.pg_repack
ps.postgis
]);
Expand All @@ -158,9 +158,9 @@ self: super: {
Here's a recipe on how to override a particular plugin through an overlay:
```
self: super: {
postgresql_11 = super.postgresql_11.override { this = self.postgresql_11; } // {
pkgs = super.postgresql_11.pkgs // {
pg_repack = super.postgresql_11.pkgs.pg_repack.overrideAttrs (_: {
postgresql_15 = super.postgresql_15.override { this = self.postgresql_15; } // {
pkgs = super.postgresql_15.pkgs // {
pg_repack = super.postgresql_15.pkgs.pg_repack.overrideAttrs (_: {
name = "pg_repack-v20181024";
src = self.fetchzip {
url = "https://github.com/reorg/pg_repack/archive/923fa2f3c709a506e111cc963034bf2fd127aa00.tar.gz";
Expand Down
10 changes: 5 additions & 5 deletions nixos/modules/services/databases/postgresql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ in

package = mkOption {
type = types.package;
example = literalExpression "pkgs.postgresql_11";
example = literalExpression "pkgs.postgresql_15";
description = lib.mdDoc ''
PostgreSQL package to use.
'';
Expand All @@ -78,7 +78,7 @@ in
dataDir = mkOption {
type = types.path;
defaultText = literalExpression ''"/var/lib/postgresql/''${config.services.postgresql.package.psqlSchema}"'';
example = "/var/lib/postgresql/11";
example = "/var/lib/postgresql/15";
description = lib.mdDoc ''
The data directory for PostgreSQL. If left as the default value
this directory will automatically be created before the PostgreSQL server starts, otherwise
Expand Down Expand Up @@ -387,7 +387,7 @@ in
extraPlugins = mkOption {
type = types.listOf types.path;
default = [];
example = literalExpression "with pkgs.postgresql_11.pkgs; [ postgis pg_repack ]";
example = literalExpression "with pkgs.postgresql_15.pkgs; [ postgis pg_repack ]";
description = lib.mdDoc ''
List of PostgreSQL plugins. PostgreSQL version for each plugin should
match version for `services.postgresql.package` value.
Expand All @@ -399,7 +399,7 @@ in
default = {};
description = lib.mdDoc ''
PostgreSQL configuration. Refer to
<https://www.postgresql.org/docs/11/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE>
<https://www.postgresql.org/docs/15/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE>
for an overview of `postgresql.conf`.
::: {.note}
Expand Down Expand Up @@ -461,7 +461,7 @@ in
base = if versionAtLeast config.system.stateVersion "23.11" then pkgs.postgresql_15
else if versionAtLeast config.system.stateVersion "22.05" then pkgs.postgresql_14
else 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 "20.03" then mkThrow "11"
else if versionAtLeast config.system.stateVersion "17.09" then mkThrow "9_6"
else mkThrow "9_5";
in
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/misc/glom/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
, isocodes
, gtksourceview
, gtksourceviewmm
, postgresql_11
, postgresql_15
, gobject-introspection
, yelp-tools
, wrapGAppsHook
Expand Down Expand Up @@ -93,7 +93,7 @@ in stdenv.mkDerivation rec {
python3.pkgs.pygobject3
gtksourceview
gtksourceviewmm
postgresql_11 # for pg_config
postgresql_15 # for pg_config
];

enableParallelBuilding = true;
Expand Down
11 changes: 0 additions & 11 deletions pkgs/servers/sql/postgresql/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,6 @@ let
};

mkPackages = self: {
# TODO: remove ahead of 23.11 branchoff
# "PostgreSQL 11 will stop receiving fixes on November 9, 2023"
postgresql_11 = self.callPackage generic {
version = "11.21";
psqlSchema = "11.1"; # should be 11, but changing it is invasive
hash = "sha256-B7CDdHHV3XeyUWazRxjzuhCBa2rWHmkeb8VHzz/P+FA=";
this = self.postgresql_11;
thisAttr = "postgresql_11";
inherit self;
};

postgresql_12 = self.callPackage generic {
version = "12.16";
psqlSchema = "12";
Expand Down
4 changes: 0 additions & 4 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27080,14 +27080,12 @@ with pkgs;
timescaledb-tune = callPackage ../development/tools/database/timescaledb-tune { };

inherit (import ../servers/sql/postgresql pkgs)
postgresql_11
postgresql_12
postgresql_13
postgresql_14
postgresql_15
postgresql_16

postgresql_11_jit
postgresql_12_jit
postgresql_13_jit
postgresql_14_jit
Expand All @@ -27098,12 +27096,10 @@ with pkgs;
postgresql_jit = postgresql_15_jit.override { this = postgresql_jit; };
postgresqlPackages = recurseIntoAttrs postgresql.pkgs;
postgresqlJitPackages = recurseIntoAttrs postgresql_jit.pkgs;
postgresql11Packages = recurseIntoAttrs postgresql_11.pkgs;
postgresql12Packages = recurseIntoAttrs postgresql_12.pkgs;
postgresql13Packages = recurseIntoAttrs postgresql_13.pkgs;
postgresql14Packages = recurseIntoAttrs postgresql_14.pkgs;
postgresql16Packages = recurseIntoAttrs postgresql_16.pkgs;
postgresql11JitPackages = recurseIntoAttrs postgresql_11_jit.pkgs;
postgresql12JitPackages = recurseIntoAttrs postgresql_12_jit.pkgs;
postgresql13JitPackages = recurseIntoAttrs postgresql_13_jit.pkgs;
postgresql14JitPackages = recurseIntoAttrs postgresql_14_jit.pkgs;
Expand Down

0 comments on commit 1220a4d

Please sign in to comment.