Building and Testing Database extensions with Nix
summary
Shows how Nix builds C extensions for PostgreSQL and Redis, using Nixpkgs and PGXS, and enforces that extensions must match the major Postgres version so mismatches fail to load; integrates extensions by setting PG_LIB_DIR and wrapping Postgres so extensions are discoverable. Uses testing.postgres and pytest with Hypothesis and PG temp to run ephemeral instances for tests. Produces Docker images via nix buildImage but hits GitLab CI limits (no docker socket), so images are exported as tarballs and pushed from another runner.
AI-written summary · about
