nixpkgs/nixos/doc/manual
Maximilian Bosch 43dbeae02d
postgresql: pass through JIT-enabled variant of non-JIT postgres and vice versa
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
2023-03-29 08:39:46 +02:00
..
administration nixos-render-docs: add structural includes, use for manual 2023-02-12 13:02:42 +01:00
configuration nixos-render-docs: add structural includes, use for manual 2023-02-12 13:02:42 +01:00
development Merge pull request #211855 from hercules-ci/lib-modules-disabledModules-module-with-key 2023-03-09 16:16:37 +01:00
installation nixos/manual: fix typos in install instructions 2023-02-22 15:40:33 +01:00
manpages nixos/doc: don't prescribe OS / manual name 2023-02-23 20:53:04 +01:00
release-notes postgresql: pass through JIT-enabled variant of non-JIT postgres and vice versa 2023-03-29 08:39:46 +02:00
contributing-to-this-manual.chapter.md nixos/manual: remove md-to-db 2023-02-10 06:40:15 +01:00
default.nix nixos/manual: apply options preprocessing to full manual 2023-03-19 13:02:03 +01:00
man-pages.xml nixos/manual: inline man-configuration.xml 2023-02-12 11:55:10 +01:00
manual.md nixos/manual: render html with nixos-render-doc if !allowDocBook 2023-02-21 18:26:41 +01:00
nixos-options.md nixos-render-docs: add structural includes, use for manual 2023-02-12 13:02:42 +01:00
preface.md nixos-render-docs: add structural includes, use for manual 2023-02-12 13:02:42 +01:00
README.md nixos/manual: Fix link to contributing guide 2021-07-16 22:55:28 -07:00