Commit Graph

338 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
a0b09dd7a1 postgresql: refactor attributes
There is no need to call the `withoutJIT` passthru explicitly here - the
default is without JIT anyway. This allows us to change the passthru to
work differently *without* affecting every `postgresql_xx` top-level
package.
2026-06-29 20:27:31 +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
Leona Maroni
a3f56d583f postgresql_13: drop as it's EOL 2025-11-18 12:32:17 +01:00
Kamil Monicz
6cdfc25ae4 postgresql_18: init at 18beta1 2025-07-05 11:52:42 +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
Maximilian Bosch
eb96c8dc5b postgresql: refactor postgresqlVersions attribute & tests
Every postgresql testcase essentially does the following things:

* Filter `postgresqlVersions` for server packages
* Filter postgresql server packages for suitable ones (i.e. extensions
  must support the given version)
* Generate an attribute-set of testcases

The first item became necessary in
7ab1e88833 given that
`postgresql/default.nix` now exposes JIT and non-JIT servers AND a
`libpq` that is not suitable for the tests here.

This changes restructures this a little bit, i.e.:

* Having an attribute-set that contains a bunch of postgresql servers
  and a single client package seems odd (and the sole consumer of
  `postgresqlVersions` in nixpkgs, the test suite, has to take that into
  account). Hence, postgresql's default.nix now provides `libpq` (the client)
  and a `postgresqlVersions` attribute with all supported JIT and non-JIT
  variants of postgresql.

* Each test-case gets a third argument, a function called `genTests`:
  this function sets `recurseForDerivations = true;` and generates an
  attribute-set of tests for each postgresql version given a function
  that returns a testcase or multiple test-cases (`makeTestFor`). The
  argument to `makeTestFor` is a postgresql server package.

  This function also accepts a filter predicate that is passed against
  `filterAttrs` to remove postgresql server packages that are not
  suitable for the test (e.g. because the version isn't supported by the
  extension to test).

I checked by making sure that the `.drv` doesn't change on staging with
this change on top for postgresq, postgresql-jit,
postgresql-wal-receiver, postgresql-tls-client-cert, anonymizer, pgjwt,
pgvecto-rs, timescaledb, tsja and wal2json.
2025-01-26 21:58:57 +01:00
Wolfgang Walther
546ece569b libpq: init at 17.2
Resolves #61580
2025-01-19 12:49:21 +01:00
Silvan Mosberger
667d42c00d treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev 57b193d8dd
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:27:17 +01:00
Maximilian Bosch
0b3eef7441 postgresql_12: remove
This will be EOL at the end of November, so there's little reason to
keep it in 24.11[1]. As discussed, we'd like to keep it for as long as
possible to make sure there's a state in nixpkgs that has the latest
minor of postgresql_12 available with the most recent CVEs fixed for
people who cannot upgrade[2].

This aspect has been made explicit in the manual now for the next .11
release.

During the discussions it has been brought up that if people just do
`services.postgresql.enable = true;` and let the code decide the
postgresql version based on `system.stateVersion`, there's a chance that
such EOL dates will be missed. To make this harder, a warning will now
be raised when using the stateVersion-condition and the oldest still
available major is selected.

Additionally regrouped the postgresql things in the release notes to
make sure these are all shown consecutively. Otherwise it's a little
hard to keep track of all the changes made to postgresql in 24.11.

[1] https://endoflife.date/postgresql
[2] https://github.com/NixOS/nixpkgs/pull/353158#issuecomment-2453056692
2024-11-15 09:17:06 +01:00
Wolfgang Walther
4cc4534295 postgresql_17: init at 17.0 2024-10-26 15:15:24 +02:00
Wolfgang Walther
0487937af3 postgresql: add readme with eol-policy
This was discussed and agreed on in [1].

[1]: https://github.com/NixOS/nixpkgs/pull/310580#discussion_r1597284693
2024-06-14 09:38:23 +02:00
Wolfgang Walther
aea4ba847a postgresql: remove thisAttr argument by calling tests directly
Previously, it was not possible to run tests on an overridden derivation, because
the derivation under test was always pulled from pkgs.

With this change, the following will return the same test:

  postgresql_jit.tests

and

  (postgresql.override { jitSupport = true; }).tests
2024-04-04 08:41:17 +02:00
Wolfgang Walther
4b6bce5c31 postgresql: refactor to remove "this" argument
This was proposed by abbradar in #150801, but left out of the follow up PR
#221851 by Ma27 to reduce the size of the diff. Compared to the initial
proposal this includes the callPackage call in the recursion, which avoids
breaking the withJIT/withoutJIT helpers.

In terms of nixpkgs, this is a pure refactor, no derivations change. However,
this makes downstream expressions like the following possible:

  (postgresql.override { jitSupport = true; }).pkgs.postgis

This would have not worked before without passing another "this" argument,
which is error prone as can be seen in this example:

  https://github.com/PostgREST/postgrest/pull/3222/files
2024-03-15 21:11:09 +01:00
Wolfgang Walther
62635c9643 postgresql: refactor mkPackages in default.nix
Refactors some low hanging fruit in default.nix to make it easier to add new
versions later on.

Pure refactor, not changing any derivations.

This change makes it easier to add new versions in default.nix without messing
up - and also prevents us from adding version-specific arguments in default.nix
by accident in the future. Those should be put in the versioned .nix files
instead.
2024-03-15 18:51:02 +01:00
Wolfgang Walther
1d9f2bd726 postgresql: refactor to split up default.nix (2/2)
The recommended [1] structure for a package regarding versioning is to have each
version in a separate file. This commit just mechanically copies code around
without any changes.

Pure refactor, not changing any derivations.

[1]: pkgs/README.md
2024-03-15 18:51:02 +01:00
Wolfgang Walther
9af8c0a3b7 postgresql: refactor to split up default.nix (1/2)
This just renames default.nix to generic.nix, because the biggest chunk
of code should move that way in the next commit. This gives us a much
better diff for the next commit and makes rebasing **much** easier in
case of changes. This commit does not stand on its own and needs to go
in with the next commit (2/2).
2024-03-15 18:51:02 +01:00
Wolfgang Walther
4c8e7af941 postgresql: refactor to remove useless references to "self"
No need to reference self here, because llvmPackages / stdenv' are available
in that scope anyway. Pure refactor, derivations don't change.
2024-03-15 18:51:02 +01:00
Wolfgang Walther
9ef7195e08 postgresql: refactor to move packages.nix to ext/default.nix (1/2)
This commit is split up into two commits to allow git to detect renames,
make rebasing easier and allow a working entry in .git-blame-ignore-revs.

To allow bisecting we allow evaluation on every commit by moving the extensions
into ext/ext/ first and back to ext/ with the next commit.
2024-03-15 18:50:20 +01:00
Wolfgang Walther
01463448be postgresql: refactor to move locale-binary-path.patch into patches/
Seems to have been put in the wrong place.
2024-03-15 18:50:19 +01:00
Mario Rodas
2526c59458 Revert "postgresql: Fix build with libxml2 2.12"
This reverts commit 2ed47724a6.
2024-02-08 04:20:00 +00:00
Mario Rodas
cbb254b9f0 postgresql_16: 16.1 -> 16.2
Changelog: https://www.postgresql.org/docs/release/16.2/
2024-02-08 04:20:00 +00:00
Mario Rodas
2ad23c3f31 postgresql_15: 15.5 -> 15.6
Changelog: https://www.postgresql.org/docs/release/15.6/
2024-02-08 04:20:00 +00:00
Mario Rodas
60a659a0c3 postgresql_14: 14.10 -> 14.11
Changelog: https://www.postgresql.org/docs/release/14.11/
2024-02-08 04:20:00 +00:00
Mario Rodas
aa9a97dc17 postgresql_13: 13.13 -> 13.14
Changelog: https://www.postgresql.org/docs/release/13.14/
2024-02-08 04:20:00 +00:00
Mario Rodas
625f00d753 postgresql_12: 12.17 -> 12.18
Changelog: https://www.postgresql.org/docs/release/12.18/
2024-02-08 04:20:00 +00:00
Mario Rodas
005a253cb2 postgresql: add support to PL/Python 2024-01-12 04:20:00 +00:00
Jan Tojnar
2ed47724a6 postgresql: Fix build with libxml2 2.12
libxml 2.12.0 made the error argument of xmlStructuredErrorFunc const
resulting in -Wincompatible-function-pointer-types error with CLang 16 and GCC 14.
61034116d0
2023-12-26 23:52:27 +01:00
Arnar Gauti Ingason
5841f51f88 postgresql: add pam support on linux 2023-12-12 08:22:06 +01:00
Mario Rodas
57970bb73a postgresql_jit: fix build
These patches are already included in the latest release.

This reverts commit 8fbd381b8a.
2023-11-12 04:20:00 +00:00
Mario Rodas
943ad0d53e postgresql_16: 16.0 -> 16.1
Changelog: https://www.postgresql.org/docs/release/16.1/
2023-11-10 04:20:00 +00:00
Mario Rodas
b38f22b9ca postgresql_15: 15.4 -> 15.5
Changelog: https://www.postgresql.org/docs/release/15.5/
2023-11-10 04:20:00 +00:00
Mario Rodas
381fc074de postgresql_14: 14.9 -> 14.10
Changelog: https://www.postgresql.org/docs/release/14.10/
2023-11-10 04:20:00 +00:00
Mario Rodas
c7a1eb3332 postgresql_13: 13.12 -> 13.13
Changelog: https://www.postgresql.org/docs/release/13.13/
2023-11-10 04:20:00 +00:00
Mario Rodas
1abcce65a9 postgresql_12: 12.16 -> 12.17
Changelog: https://www.postgresql.org/docs/release/12.17/
2023-11-10 04:20:00 +00:00
Mario Rodas
8a770420d4 postgresql: add changelog to meta 2023-11-10 04:20:00 +00:00
github-actions[bot]
97868dae8e Merge master into staging-next 2023-10-31 06:00:58 +00:00
Maximilian Bosch
1220a4d4dd postgresql_11: remove
As described in the release lifecycle docs from postgresql[1], v11 will
stop receiving fixes as of Nov 9 2023. This means it's EOL throughout
the entire lifetime of 23.11, so let's drop it now.

A lot of examples are also referencing postgresql_11. Where it's
sensible, use postgresql_15 as example now to avoid confusion.

This is also handy because the LLVM 16 fix for postgresql is not
available for postgresql 11 ;-)

[1] https://www.postgresql.org/support/versioning/
2023-10-30 10:41:16 +01:00
Maximilian Bosch
8fbd381b8a postgresql_jit: fix build
Failing Hydra build: https://hydra.nixos.org/build/239477682/nixlog/1

This got fixed upstream already in the release branches, applying the
patches here solves the issue.

This skips v11 since there's no patch available and it will be dropped
soon anyways[1].

[1] #264250
2023-10-29 23:58:28 +01:00
Meet Barot
19a4154a7c postgresql: Add meta.pkgConfigModules and test 2023-10-16 00:36:24 -04:00
Mario Rodas
eb745fa4d7 Merge pull request #259734 from marsam/postgresql-update-extensions
postgresql: update extensions
2023-10-10 08:35:15 -05:00
Yureka
8a0223ec08 postgresql: reorganize musl patches (#260067)
This also adds support for building postgresql 15 and 16 under musl.
2023-10-10 00:51:44 +02:00
Mario Rodas
9bd59c622a postgresql: add dlSuffix to passthru
PostgreSQL changed the extension of its extensions in Darwin to use .dylib [1]

[1] b55f62abb2
2023-09-22 04:20:00 +00:00
Steve Purcell
ae5b96f3ab postgresql_16: init at 16.0 2023-09-16 18:19:06 +02:00
github-actions[bot]
4a9909e0db Merge master into staging-next 2023-08-19 00:01:42 +00:00
Sean D Gillespie
acc01be813 postgresql: fix musl patches 2023-08-18 13:16:14 -05:00
ajs124
061c96b486 postgresql_15: 15.3 -> 15.4
https://www.postgresql.org/docs/release/15.4/
2023-08-10 23:19:35 -05:00
ajs124
8f5976b479 postgresql_14: 14.8 -> 14.9
https://www.postgresql.org/docs/release/14.9/
2023-08-10 23:19:35 -05:00
ajs124
f256648786 postgresql_13: 13.11 -> 13.12
https://www.postgresql.org/docs/release/13.12/
2023-08-10 23:19:35 -05:00
ajs124
363048444b postgresql_12: 12.15 -> 12.16
https://www.postgresql.org/docs/release/12.16/
2023-08-10 23:19:35 -05:00