Jump to content

PostgreSQL: Difference between revisions

clarify that `services.postgresql.package` is fixed based on `system.stateVersion`
imported>Hofsiedge
m (→‎Limit Access: - fixed alighnment in the authentication field)
imported>Colinsane
(clarify that `services.postgresql.package` is fixed based on `system.stateVersion`)
Line 109: Line 109:
=== Set the Postgresql versions ===
=== Set the Postgresql versions ===


By default, NixOS uses whatever Postgres version that comes with the  [https://search.nixos.org/packages?query=postgresql "pkgs.postgresql" package]. To avoid sudden breaking changes you can fix the Postgres version by using a more specific Nix package:
By default, NixOS uses whatever Postgres version shipped as default for your [https://search.nixos.org/options?show=system.stateVersion system.stateVersion]. To use a different or more recent version, you can set it manually:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 118: Line 118:
};
};
</syntaxhighlight>
</syntaxhighlight>
Note that changing the package version does not trigger and automatic migrations of your existing databases: if you update Postgres you should be ready to migrate any existing databases manually.


* [https://search.nixos.org/packages?query=postgresql_ Available Nixpkgs Postgresql versions]
* [https://search.nixos.org/packages?query=postgresql_ Available Nixpkgs Postgresql versions]
Anonymous user