mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-10 17:54:53 +01:00
This is useful if your postgresql version is dependant on
`system.stateVersion` and not pinned down manually. Then it's not
necessary to find out which version exactly is in use and define
`package` manually, but just stay with what NixOS provides as default:
$ nix-instantiate -A postgresql
/nix/store/82fzmb77mz2b787dgj7mn4a8i4f6l6sn-postgresql-14.7.drv
$ nix-instantiate -A postgresql_jit
/nix/store/qsjkb72fcrrfpsszrwbsi9q9wgp39m50-postgresql-14.7.drv
$ nix-instantiate -A postgresql.withJIT
/nix/store/qsjkb72fcrrfpsszrwbsi9q9wgp39m50-postgresql-14.7.drv
$ nix-instantiate -A postgresql.withJIT.withoutJIT
/nix/store/82fzmb77mz2b787dgj7mn4a8i4f6l6sn-postgresql-14.7.drv
I.e. you can use postgresql with JIT (for complex queries only[1]) like
this:
services.postgresql = {
enable = true;
enableJIT = true;
};
Performing a new override instead of re-using the `_jit`-variants for
that has the nice property that overlays for the original package apply
to the JIT-enabled variant, i.e.
with import ./. {
overlays = [
(self: super: {
postgresql = super.postgresql.overrideAttrs (_: { fnord = "snens"; });
})
];
};
postgresql.withJIT.fnord
still gives the string `snens` whereas `postgresql_jit` doesn't have the
attribute `fnord` in its derivation.
[1] https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-JIT-ABOVE-COST
|
||
|---|---|---|
| .. | ||
| release-notes.md | ||
| rl-1310.section.md | ||
| rl-1404.section.md | ||
| rl-1412.section.md | ||
| rl-1509.section.md | ||
| rl-1603.section.md | ||
| rl-1609.section.md | ||
| rl-1703.section.md | ||
| rl-1709.section.md | ||
| rl-1803.section.md | ||
| rl-1809.section.md | ||
| rl-1903.section.md | ||
| rl-1909.section.md | ||
| rl-2003.section.md | ||
| rl-2009.section.md | ||
| rl-2105.section.md | ||
| rl-2111.section.md | ||
| rl-2205.section.md | ||
| rl-2211.section.md | ||
| rl-2305.section.md | ||