Commit Graph

220 Commits

Author SHA1 Message Date
Wolfgang Walther
4160692646 postgresql: flatten generic.nix
Removes all the indentation in generic.nix, which is possible because
we're not calling the generic function recursively anymore anyway.
2026-07-05 14:43:35 +02:00
Wolfgang Walther
16d53dfcf6 postgresql: move postgresqlWithPackages to separate file
Moves the function to a separate file and makes it callPackage-able. Now
that buildEnv also supports finalAttrs, the finalPackage construct can
also be rewritten that way.

This gives us clear separation of concern between the package builder in
generic.nix and wrapper.nix.
2026-07-05 14:41:40 +02:00
nixpkgs-ci[bot]
f56d9e08af Merge master into staging-next 2026-07-02 12:40:31 +00:00
Wolfgang Walther
6fcd01ff0e Reapply "postgresql: fix overrides being forgotten on withPackages"
This reverts commit 6681cb540e.
2026-06-29 20:31:23 +02:00
Wolfgang Walther
5cf857ed82 postgresql: return wrapper from withoutJIT passthru
Before this change, we would return:
- The postgresql derivation itself from `postgresql.withoutJIT`,
- A wrapper without any extensions at all, from
`postgresql_jit.withoutJIT`.

This changes makes it that every call to `.withJIT` and `.withoutJIT`
returns a wrapper and never the base derivation. More consistent and
easier to reason about.
2026-06-29 20:30:39 +02:00
K900
edf8f2c356 Merge remote-tracking branch 'origin/staging-next' into staging 2026-06-20 15:55:36 +03:00
Michael Daniels
f9fa41bfe9 postgresql_*: set strictDeps for withPackages/JIT
Context: https://github.com/NixOS/nixpkgs/pull/531301#issuecomment-4752253522
2026-06-19 17:21:51 -04:00
nixpkgs-ci[bot]
bda47f89e2 Merge staging-next into staging 2026-06-19 18:38:23 +00:00
Wolfgang Walther
8260f81399 postgresql: remove pkgsStatic support
This breaks again and again - and upstream is not really going to
support it anyway. It never fully worked - and the important thing is to
be able to build `pkgsStatic.libpq` anyway, which works independently of
the server package.
2026-06-13 17:32:43 +02:00
Wolfgang Walther
976e9fbdc7 postgresql_19: init at 19beta1
Release Notes:
https://www.postgresql.org/about/news/postgresql-19-beta-1-released-3313/
2026-06-13 11:19:46 +02:00
Maximilian Bosch
4ed2dff2b5 postgresql: reduce duplicated postgresqlWithPackages (#509714) 2026-04-14 01:35:38 +00:00
Michael Schneider
b7cae3429d postgresql: reduce duplicated postgresqlWithPackages 2026-04-13 21:16:59 +01:00
Michael Schneider
c95ef668a5 postgresql: cleanup unused imports 2026-04-13 21:07:01 +01:00
Wolfgang Walther
6681cb540e Revert "postgresql: fix overrides being forgotten on withPackages" 2026-02-14 21:37:40 +00:00
Maximilian Bosch
d9e9c71640 postgresql: fix overrides being forgotten on withPackages (#488692) 2026-02-13 14:02:07 +00:00
Wolfgang Walther
bc365bea1c postgresql_17: 17.7 -> 17.8
Release Notes:
https://github.com/postgres/postgres/blob/REL_17_STABLE/doc/src/sgml/release-17.sgml

Security: CVE-2026-2003, CVE-2026-2004, CVE-2026-2005, CVE-2026-2006,
CVE-2026-2007
2026-02-10 10:22:43 +01:00
magic_rb
a1c8902712 postgresql: fix overrides being forgotten on withPackages
Signed-off-by: magic_rb <richard@brezak.sk>
2026-02-09 12:33:43 +01:00
jopejoe1
3429827f24 postgresql_jit: set pname 2026-02-07 16:43:34 +01:00
Bouke van der Bijl
b67248cd59 nixos/postgresql: don't create postgresql-setup if no setup is needed
Also add postgresql replication test

Fixes #469859
2025-12-22 11:01:11 +01:00
Ihar Hrachyshka
567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00
Artturin
61043c3ab4 postgresql: Fix cross
```
clang: error: unable to execute command: posix_spawn failed: Exec format error
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
2025-12-10 15:45:00 +02:00
David McFarland
d613d20a13 treewide: fix nix-env eval in cross 2025-12-04 19:44:19 -04:00
Wolfgang Walther
07885bcfa1 postgresql_18: 18.0 -> 18.1
Release Notes:
4b324845ba/doc/src/sgml/release-18.sgml

Fixes:
CVE-2025-12817
CVE-2025-12818
2025-11-11 15:14:18 +01:00
Wolfgang Walther
8e8cc8abef postgresql_17: 17.6 -> 17.7
Release Notes:
fbb530a3df/doc/src/sgml/release-17.sgml

Fixes:
CVE-2025-12817
CVE-2025-12818
2025-11-11 15:14:17 +01:00
Maximilian Bosch
9da1bc57fd postgresql_{17,18}: fix build
After a recent update of libxml2 the build fails with

    /nix/store/casz7al9kpkg52sn156h6slqijwkybqj-libxml2-2.15.0-bin/bin/xmllint --nonet --path . --path . --output postgres-full.xml --noent --valid postgres.sgml
    ref/pg_combinebackup.sgml:287: validity error : standalone: normalization of attribute linkend on xref by external subset declaration
   state of the cluster using <xref linkend="app-pgchecksums "/> is

Reported in #448752 (not closing on purpose since the issue is actually
about another problem).
2025-10-05 13:09:55 +02:00
Wolfgang Walther
1043895c39 postgresql: pin LLVM 20
PostgreSQL is still broken with LLVM 21.
2025-09-21 16:44:46 +02:00
Wolfgang Walther
15efb120d1 postgresql: fix build
The test is only available on PostgreSQL 18, thus the replace will fail
on anything lower.
2025-08-15 08:36:32 +02:00
Maximilian Bosch
9024fc95dd Merge: postgresql.pg_config: make overrideable (#426704) 2025-08-13 18:02:42 +02:00
Maximilian Bosch
a1ab3bdb47 postgresql_18: disable NUMA test-case
While the functionality itself works, it is broken inside the sandbox
since NUMA information is exposed via sysfs which is not available in
the sandbox.
2025-08-10 13:55:14 +02:00
Wolfgang Walther
f8bc00efc5 postgresql.pg_config: make overrideable
This allows `postgresql.withPackages` to easily override the paths to
the default and man outputs for `pg_config`. It avoids all
`buildEnv`-dev-output hackery, which it didn't properly support, and
separates the logic cleanly.
2025-08-04 16:53:01 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Maximilian Bosch
cf0661c6f3 postgresql_18: turn off NUMA support in 18beta2 as well
Follows up on #426118

Still produces a broken test:

    diff -U3 /build/source/src/test/regress/expected/numa.out /build/source/src/test/regress/results/numa.out
    --- /build/source/src/test/regress/expected/numa.out	1970-01-01 00:00:01.000000000 +0000
    +++ /build/source/src/test/regress/results/numa.out	2025-07-19 08:44:02.793368816 +0000
    @@ -6,8 +6,4 @@
     -- switch to superuser
     \c -
     SELECT COUNT(*) >= 0 AS ok FROM pg_shmem_allocations_numa;
    - ok
    -----
    - t
    -(1 row)
    -
    +ERROR:  invalid NUMA node id outside of allowed range [0, 0]: 1
2025-07-19 12:04:19 +02:00
Wolfgang Walther
7451df7a5e postgresql.withPackages: add dev output
This avoids leaking the dev output and all its dependencies into regular
postgresql.withPackages builds, most notably postgresql_jit.
2025-07-06 18:16:23 +02:00
nixpkgs-ci[bot]
61be326d8b Merge master into staging-next 2025-07-05 18:05:00 +00:00
Kamil Monicz
ec2006affb postgresql_18: support curl/numa/uring 2025-07-05 11:52:42 +02:00
Wolfgang Walther
9a146d1244 postgresql.withPackages.pg_config: fix paths
Previously, pg_config would report the paths of the underlying
postgresql derivation and not the paths of the buildEnv that
postgresql.withPackages creates.

That's a problem when users of pg_config use it to find PostgreSQL's
sharedir, in which they'd like to find the extensions added via
withPackages. Those are only linked into the created buildEnv, but not
available in the postgresql derivation.

By providing our own nix-support/pg_config.env file, we can swap out
those paths. We also do the same for the -man output, because this
output is linked into buildEnv as well. Other paths, which are not
available in the buildEnv environment, will still link to the original
postgresql derivation. Win-win!
2025-06-24 10:01:07 +02:00
Kamil Monicz
6ca1ec94f5 postgresql: configurable blocksize 2025-05-29 13:52:21 +02:00
Wolfgang Walther
e1573ae30b postgresqlPackages: remove unused inputs
Thanks, deadnix.
2025-05-11 10:44:16 +02:00
K900
f96ac2dcd6 Merge remote-tracking branch 'origin/master' into staging-next 2025-04-26 09:07:48 +03:00
Fernando Rodrigues
05580f4b44 treewide: switch instances of lib.teams.*.members to the new meta.teams attribute
Follow-up to #394797.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2025-04-25 22:20:17 -03:00
Wolfgang Walther
fee40ecec2 postgresql: add outputCheck for llvmPackages.llvm.lib
This should not leak into the out/lib outputs to keep the closure size
small.
2025-04-12 17:31:34 +02:00
Wolfgang Walther
9f3bea8dca pkgsStatic.{libpq,postgresql}: fix linking against libpq.a
This can be observed when building
haskellPackages.postgresql-libpq-pkgconfig. This is currently pinned to
postgresql_16 in pkgsStatic, but when unpinning it, it will fail with
the mentioned error on master. With this fix, it successfully builds
with postgresql_17 / libpq.
2025-04-05 20:00:14 +02:00
Wolfgang Walther
dd5fd6cc22 postgresql: always build with JIT enabled
This changes the build to always enable JIT - but to only enable it at
run-time, when required. This keeps the runtime closure small without
JIT, but allows enabling it without a rebuild. We can do this, because
JIT is actually built as a shared module, which is loaded at run-time.
We put it into a -jit output and only link it into the environment when
requested.

Under the hood, this uses withPackages and adds the "JIT package" -
thus, to be able to use withPackages on top of that, we also need to be
able to apply withPackages repeatedly.

This cuts down the number of NixOS tests in half, because we don't need
to run it for every version with and without JIT anymore. There really
is no point in running everything with llvmjit.so in place, when the
queries are not making use of it anyway.

Also, we only need to build each extension once and not twice, further
reducing the number of rebuilds required for PRs touching postgresql.
2025-04-05 20:00:13 +02:00
Wolfgang Walther
dcb7a17994 pkgsMusl.postgresql_jit: disable tests 2025-04-05 20:00:10 +02:00
Maximilian Bosch
e376aa94e4 Merge: postgresql.pg_config: add check to confirm output is correct (#392418) 2025-03-30 12:32:51 +02:00
nixpkgs-ci[bot]
f079e356d1 Merge staging-next into staging 2025-03-25 00:16:28 +00:00
Wolfgang Walther
6db5dcc013 postgresql.pg_config: add check to confirm output is correct
This is only tested on native builds against the output of the original
pg_config, which should be enough.
2025-03-23 20:40:37 +01:00
Wolfgang Walther
7a35667a1c postgresql: simplify doInstallCheck condition and fix comments 2025-03-23 16:43:00 +01:00
nixpkgs-ci[bot]
3b3300fdd1 Merge staging-next into staging 2025-03-22 12:05:57 +00:00
Vladimír Čunát
d0f3296284 postgresql: drop tests on aarch64-darwin, too
I don't know.  No progress in sight.
Let's at least unblock all those dependees.
2025-03-22 07:43:34 +01:00