Unverified Commit 131a9d59 authored by Wolfgang Walther's avatar Wolfgang Walther Committed by GitHub
Browse files

postgresql_13: drop as it's EOL (#462543)

parents 64d2eb43 a3f56d58
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@

- `postgresql` and `libpq` don't provide `pg_config` by default anymore. Instead, `pg_config` is available via `postgresql.pg_config` or `libpq.pg_config`. This allowed implementing it as a shell script, which can be built for both the build and host systems when cross-compiling. If your build fails to find `pg_config`, add `postgresql.pg_config` or `libpq.pg_config` to `nativeBuildInputs`.

- `postgresql_13` has been removed since it reached its end of life.

- The [`no-broken-symlinks` hook](https://nixos.org/manual/nixpkgs/unstable/#no-broken-symlinks.sh) was added to catch builds containing dangling or reflexive symlinks, as these are indicative of problems with packaging.
  The hook can be disabled by providing `dontCheckForBrokenSymlinks = true;` as an argument to `mkDerivation`.
  For more information, [check the docs](https://nixos.org/manual/nixpkgs/unstable/#no-broken-symlinks.sh) or [see this PR](https://github.com/NixOS/nixpkgs/pull/370750).
+5 −20
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ Best practice is to name the map after the database role it manages to avoid nam
## Upgrading {#module-services-postgres-upgrading}

::: {.note}
The steps below demonstrate how to upgrade from an older version to `pkgs.postgresql_13`.
The steps below demonstrate how to upgrade from an older version to `pkgs.postgresql_15`.
These instructions are also applicable to other versions.
:::

@@ -176,8 +176,8 @@ each major version has some internal changes in the databases' state. Because of
NixOS places the state into {file}`/var/lib/postgresql/<version>` where each `version`
can be obtained like this:
```
$ nix-instantiate --eval -A postgresql_13.psqlSchema
"13"
$ nix-instantiate --eval -A postgresql_15.psqlSchema
"15"
```
For an upgrade, a script like this can be used to simplify the process:
```nix
@@ -193,7 +193,7 @@ For an upgrade, a script like this can be used to simplify the process:
      let
        # XXX specify the postgresql package you'd like to upgrade to.
        # Do not forget to list the extensions you need.
        newPostgres = pkgs.postgresql_13.withPackages (pp: [
        newPostgres = pkgs.postgresql_15.withPackages (pp: [
          # pp.plv8
        ]);
        cfg = config.services.postgresql;
@@ -229,22 +229,7 @@ The upgrade process is:
  2. Login as root (`sudo su -`).
  3. Run `upgrade-pg-cluster`. This will stop the old postgresql cluster, initialize a new one and migrate the old one to the new one. You may supply arguments like `--jobs 4` and `--link` to speedup the migration process. See <https://www.postgresql.org/docs/current/pgupgrade.html> for details.
  4. Change the postgresql package in NixOS configuration to the one you were upgrading to via [](#opt-services.postgresql.package). Rebuild NixOS. This should start the new postgres version using the upgraded data directory and all services you stopped during the upgrade.
  5. After the upgrade it's advisable to analyze the new cluster:

       - For PostgreSQL ≥ 14, use the `vacuumdb` command printed by the upgrades script.
       - For PostgreSQL < 14, run (as `su -l postgres` in the [](#opt-services.postgresql.dataDir), in this example {file}`/var/lib/postgresql/13`):

         ```
         $ ./analyze_new_cluster.sh
         ```

     ::: {.warning}
     The next step removes the old state-directory!
     :::

     ```
     $ ./delete_old_cluster.sh
     ```
  5. After the upgrade it's advisable to analyze the new cluster with the `vacuumdb` command printed by the upgrades script.

## Versioning and End-of-Life {#module-services-postgres-versioning}

+2 −4
Original line number Diff line number Diff line
@@ -120,10 +120,8 @@ in
            pkgs.postgresql_16
          else if versionAtLeast config.system.stateVersion "23.11" then
            pkgs.postgresql_15
          else if versionAtLeast config.system.stateVersion "22.05" then
            pkgs.postgresql_14
          else
            pkgs.postgresql_13
            pkgs.postgresql_14
        '';
        description = ''
          The package being used by postgresql.
@@ -697,7 +695,7 @@ in
          else if versionAtLeast config.system.stateVersion "22.05" then
            pkgs.postgresql_14
          else if versionAtLeast config.system.stateVersion "21.11" then
            mkWarn "13" pkgs.postgresql_13
            mkThrow "13"
          else if versionAtLeast config.system.stateVersion "20.03" then
            mkThrow "11"
          else if versionAtLeast config.system.stateVersion "17.09" then
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ import ./make-test-python.nix (
            };
            postgresql = {
              enable = true;
              package = pkgs.postgresql_13;
              package = pkgs.postgresql_14;
            };
            nginx = {
              enable = true;
+0 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ let
  # version. In other words: Do not remove the second-to-last minor version from nixpkgs,
  # yet. Update first.
  versions = {
    postgresql_13 = ./13.nix;
    postgresql_14 = ./14.nix;
    postgresql_15 = ./15.nix;
    postgresql_16 = ./16.nix;
Loading