feat(nix): expose per-version extension packages, catalog, and update tools - #2317
Draft
brainrake wants to merge 2 commits into
Draft
feat(nix): expose per-version extension packages, catalog, and update tools#2317brainrake wants to merge 2 commits into
brainrake wants to merge 2 commits into
Conversation
PostgreSQL Package Dependency Analysis: PR #2317
SummaryNo packages had MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Dependency ChangesExtracting PostgreSQL 15 dependencies...
Runtime Closure Size
Raw Dependency ClosurePostgreSQL 17 Dependency ChangesExtracting PostgreSQL 17 dependencies...
Runtime Closure Size
Raw Dependency Closure |
PostgreSQL Extension Dependency Analysis: PR #2317
SummaryNo extensions had dependencies with MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Extension DependenciesPostgreSQL 17 Extension DependenciesOrioleDB 17 Extension Dependencies |
brainrake
changed the base branch from
martonboros/psql-1530-expose-ext-perversion
to
develop
July 27, 2026 18:26
brainrake
force-pushed
the
martonboros/psql-1530-ext-catalog
branch
2 times, most recently
from
July 27, 2026 19:31
4947f27 to
d11cd58
Compare
…ce tools
Adds passthru.perVersion (version -> single-version derivation) to each
multi-version extension (18 files, one line each) -- the attrset already
existed inline as the buildEnv input, this surfaces it instead of
discarding it. No change to any buildEnv output or extension identity.
New flake-parts module nix/packages/extension-catalog.nix, exposing
(packages + legacyPackages):
- site-extensions-catalog-<major> (15/17/orioledb-17): pg-extensions-
catalog.json mapping { ext -> { extversion -> store path } }, plus
bin/{resolve,update} preset with PG_EXTENSIONS_CATALOG. Assembled at
build time from the wrappers' control files, so keys are real
extversions (pgsql-http nix "1.5.0" -> "1.5") and include
sub-extensions (postgis_topology, plcoffee, ...). unsafeDiscardReferences
keeps the closure to just the JSON (6.8 KiB, not 2.4 GiB).
- site-extensions-versions-<major> (legacyPackages): the generic
single-version packages the catalog points at (lean, no multi-version
buildEnv), so the CI matrix builds and caches them.
- Generic tools, one version each (not per-major): site-extensions-resolve
(manifest json -> store paths), download-nix-store-paths (retry/timeout
substitution, not extension-specific), site-extensions-update (chains
both + nix-env --install --remove-all onto PROFILE, atomic).
Part of PSQL-1530.
brainrake
force-pushed
the
martonboros/psql-1530-ext-catalog
branch
from
July 27, 2026 19:46
d11cd58 to
998a591
Compare
…-update postgres_prestart.sh's handle_extension_versions() now calls site-extensions-update directly instead of looping switch_<ext>_version per extension -- that resolve/download/install pipeline now lives in the nix packages added by this branch. Manifest-missing guard preserved; failure is non-fatal (matches existing behavior, and ExecStartPre already ignores exit status via the -+ prefix). Also fixes drift in postgresql.service: it had fallen out of sync with salt's live copy of the unit (ExecStartPre missing the "-" ignore-failure prefix, ReadOnlyPaths missing /usr/local). Both now match what's actually deployed on the fleet. Depends on site-extensions-update being reachable on PATH (bundled into the site profile, tracked separately) before this can actually cut over.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of PSQL-1530.
Adds
passthru.perVersion(version -> single-version derivation) to each multi-version extension (18 files, one line each).Adds flake module
nix/packages/extension-catalog.nix, exposingpackagesandlegacyPackages:site-extensions-catalog-<major>(15/17/orioledb-17)pg-extensions-catalog.jsonmapping{ ext -> { extversion -> store path } }bin/{resolve,update}that use said jsonsite-extensions-versions-<major>: single-version ext packages the catalog points at (lean, ~30 MiB closures, no multi-version buildEnv), so CI builds and caches them.site-extensions-resolve(manifest json -> store paths, readsPG_EXTENSIONS_CATALOG)download-nix-store-paths(retry/timeout substitution, not extension-specific)site-extensions-update(chains both +nix-env --install --remove-allontoPROFILE, atomic — nix-env only swaps generations on success)postgres_prestart.sh'shandle_extension_versions()now delegates tosite-extensions-updateinstead of loopingswitch_<ext>_versionper extension. Depends onsite-extensions-updatebeing reachable onPATH(site profile bundling, tracked separately) before this actually cuts over.Also fixes drift in
postgresql.service: it had fallen out of sync with salt's live copy of the unit (ExecStartPremissing the-ignore-failure prefix,ReadOnlyPathsmissing/usr/local). Both now match what's actually deployed on the fleet.