From 12e94336c6f01688ffcdea00e5608c5d8afff46c Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Tue, 22 Jul 2025 11:39:03 +0200 Subject: [PATCH 01/22] chores: opted-out nix-fast-build --- .github/workflows/nix-build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index c2f383961..215092cc0 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -106,9 +106,7 @@ jobs: df -h - name: Build psql bundle run: > - nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48" - -- --skip-cached --no-nom ${{ matrix.runner == 'macos-latest-xlarge' && '--max-jobs 1' || '' }} - --flake ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')" + nix build ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')" env: AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} From dd833ab2bbb78d57346c3c3f3f157702d8b8246c Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Thu, 24 Jul 2025 09:42:53 +0200 Subject: [PATCH 02/22] chores: set up nix-github-actions --- .github/workflows/nix-build.yml | 31 +++++++++++++++++++------------ flake.lock | 21 +++++++++++++++++++++ flake.nix | 3 +++ nix/github-actions.nix | 6 ++++++ 4 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 nix/github-actions.nix diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 215092cc0..3d610ef3c 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -15,18 +15,27 @@ permissions: packages: write jobs: + nix-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v30 + - id: set-matrix + name: Generate Nix Matrix + run: | + set -Eeu + matrix="$(nix eval --json '.#githubActions.matrix')" + echo "matrix=$matrix" >> "$GITHUB_OUTPUT" + build-run-image: + name: ${{ matrix.name }} (${{ matrix.system }}) + needs: nix-matrix + runs-on: ${{ matrix.os }} strategy: fail-fast: false - matrix: - include: - - runner: blacksmith-32vcpu-ubuntu-2404 - arch: amd64 - - runner: blacksmith-32vcpu-ubuntu-2404-arm - arch: arm64 - - runner: macos-latest-xlarge - arch: arm64 - runs-on: ${{ matrix.runner }} + matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} timeout-minutes: 180 steps: - name: Checkout Repo @@ -104,9 +113,7 @@ jobs: sudo rm -rf /tmp/* 2>/dev/null || true echo "=== AFTER CLEANUP ===" df -h - - name: Build psql bundle - run: > - nix build ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')" + - run: nix build -L '.#${{ matrix.attr }}' env: AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} diff --git a/flake.lock b/flake.lock index 9d2865e1d..b9a8b2f83 100644 --- a/flake.lock +++ b/flake.lock @@ -173,6 +173,26 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737420293, + "narHash": "sha256-F1G5ifvqTpJq7fdkT34e/Jy9VCyzd5XfJ9TO8fHhJWE=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "f4158fa080ef4503c8f4c820967d946c2af31ec9", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nix2container": { "inputs": { "flake-utils": "flake-utils_2", @@ -309,6 +329,7 @@ "git-hooks": "git-hooks", "nix-editor": "nix-editor", "nix-fast-build": "nix-fast-build", + "nix-github-actions": "nix-github-actions", "nix2container": "nix2container", "nixpkgs": "nixpkgs_4", "nixpkgs-go124": "nixpkgs-go124", diff --git a/flake.nix b/flake.nix index db14dac9a..f91facd4b 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,8 @@ git-hooks.url = "github:cachix/git-hooks.nix"; git-hooks.inputs.nixpkgs.follows = "nixpkgs"; nixpkgs-go124.url = "github:Nixos/nixpkgs/d2ac4dfa61fba987a84a0a81555da57ae0b9a2b0"; + nix-github-actions.url = "github:nix-community/nix-github-actions"; + nix-github-actions.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = @@ -36,6 +38,7 @@ nix/nixpkgs.nix nix/packages nix/overlays + nix/github-actions.nix ]; }); } diff --git a/nix/github-actions.nix b/nix/github-actions.nix new file mode 100644 index 000000000..b2f04a6c2 --- /dev/null +++ b/nix/github-actions.nix @@ -0,0 +1,6 @@ +{ inputs, ... }: +{ + flake.githubActions = inputs.nix-github-actions.lib.mkGithubMatrix { + checks = inputs.nixpkgs.lib.getAttrs [ "x86_64-linux" ] inputs.self.checks; + }; +} From a17d9af913eb2395e798ee7b63bcc40ff3100ba5 Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Mon, 11 Aug 2025 09:11:45 +0200 Subject: [PATCH 03/22] chores: comment out vestigal testinfra-ami-build --- .github/workflows/nix-build.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 3d610ef3c..7551a14fa 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -10,7 +10,7 @@ on: permissions: id-token: write - # required by testinfra-ami-build dependent workflows + # required by dependent workflows contents: write packages: write @@ -119,13 +119,6 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }} - run-testinfra: - needs: build-run-image - if: ${{ success() }} - uses: ./.github/workflows/testinfra-ami-build.yml - secrets: - DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }} - run-tests: needs: build-run-image if: ${{ success() }} From 6509b7cd26b1b394cfe01c84a2ea5c688bc218bd Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Mon, 11 Aug 2025 12:10:27 +0200 Subject: [PATCH 04/22] chores: use custom github runners --- nix/github-actions.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nix/github-actions.nix b/nix/github-actions.nix index b2f04a6c2..752f0b41a 100644 --- a/nix/github-actions.nix +++ b/nix/github-actions.nix @@ -1,6 +1,18 @@ { inputs, ... }: +let + githubPlatforms = { + "x86_64-linux" = "large-linux-x86"; + "aarch64-linux" = "large-linux-arm"; + "aarch64-darwin" = "macos-latest-xlarge"; + }; +in { flake.githubActions = inputs.nix-github-actions.lib.mkGithubMatrix { - checks = inputs.nixpkgs.lib.getAttrs [ "x86_64-linux" ] inputs.self.checks; + checks = inputs.nixpkgs.lib.getAttrs [ + "x86_64-linux" + "aarch64-linux" + "aarch64-darwin" + ] inputs.self.checks; + platforms = githubPlatforms; }; } From 7ddc794a6608577d48416e99dafcf78fd347243b Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Mon, 16 Jun 2025 10:26:20 +0200 Subject: [PATCH 05/22] feat: multiple versions for the timescaledb-apache extension --- nix/ext/timescaledb-2.9.1.nix | 65 ---------------- nix/ext/timescaledb.nix | 138 +++++++++++++++++++++++----------- nix/ext/versions.json | 14 ++++ nix/packages/postgres.nix | 1 - nix/tests/timescaledb.nix | 100 ++++++++++++++++++++++++ 5 files changed, 210 insertions(+), 108 deletions(-) delete mode 100644 nix/ext/timescaledb-2.9.1.nix create mode 100644 nix/tests/timescaledb.nix diff --git a/nix/ext/timescaledb-2.9.1.nix b/nix/ext/timescaledb-2.9.1.nix deleted file mode 100644 index 0df743671..000000000 --- a/nix/ext/timescaledb-2.9.1.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - cmake, - postgresql, - openssl, - libkrb5, -}: - -stdenv.mkDerivation rec { - pname = "timescaledb-apache"; - version = "2.9.1"; - - nativeBuildInputs = [ cmake ]; - buildInputs = [ - postgresql - openssl - libkrb5 - ]; - - src = fetchFromGitHub { - owner = "timescale"; - repo = "timescaledb"; - rev = version; - hash = "sha256-fvVSxDiGZAewyuQ2vZDb0I6tmlDXl6trjZp8+qDBtb8="; - }; - - cmakeFlags = [ - "-DSEND_TELEMETRY_DEFAULT=OFF" - "-DREGRESS_CHECKS=OFF" - "-DTAP_CHECKS=OFF" - "-DAPACHE_ONLY=1" - ] ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; - - # Fix the install phase which tries to install into the pgsql extension dir, - # and cannot be manually overridden. This is rather fragile but works OK. - postPatch = '' - for x in CMakeLists.txt sql/CMakeLists.txt; do - substituteInPlace "$x" \ - --replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/postgresql/extension\"" - done - - for x in src/CMakeLists.txt src/loader/CMakeLists.txt tsl/src/CMakeLists.txt; do - substituteInPlace "$x" \ - --replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\"" - done - ''; - - # timescaledb-2.9.1.so already exists in the lib directory - # we have no need for the timescaledb.so or control file - postInstall = '' - rm $out/lib/timescaledb.so - rm $out/share/postgresql/extension/timescaledb.control - ''; - - meta = with lib; { - description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; - homepage = "https://www.timescale.com/"; - changelog = "https://github.com/timescale/timescaledb/blob/${version}/CHANGELOG.md"; - platforms = postgresql.meta.platforms; - license = licenses.asl20; - broken = versionOlder postgresql.version "13"; - }; -} diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index 6f5681546..c8e224e9e 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -1,4 +1,5 @@ { + pkgs, lib, stdenv, fetchFromGitHub, @@ -8,51 +9,104 @@ libkrb5, }: -stdenv.mkDerivation rec { - pname = "timescaledb-apache"; - version = "2.16.1"; +let + pname = "timescaledb"; + build = + version: hash: _revision: + stdenv.mkDerivation rec { + inherit pname version; - nativeBuildInputs = [ cmake ]; - buildInputs = [ - postgresql - openssl - libkrb5 - ]; + nativeBuildInputs = [ cmake ]; + buildInputs = [ + postgresql + openssl + libkrb5 + ]; - src = fetchFromGitHub { - owner = "timescale"; - repo = "timescaledb"; - rev = version; - hash = "sha256-sLxWdBmih9mgiO51zLLxn9uwJVYc5JVHJjSWoADoJ+w="; - }; + src = fetchFromGitHub { + owner = "timescale"; + repo = "timescaledb"; + rev = version; + inherit hash; + }; - cmakeFlags = [ - "-DSEND_TELEMETRY_DEFAULT=OFF" - "-DREGRESS_CHECKS=OFF" - "-DTAP_CHECKS=OFF" - "-DAPACHE_ONLY=1" - ] ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; - - # Fix the install phase which tries to install into the pgsql extension dir, - # and cannot be manually overridden. This is rather fragile but works OK. - postPatch = '' - for x in CMakeLists.txt sql/CMakeLists.txt; do - substituteInPlace "$x" \ - --replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/postgresql/extension\"" - done - - for x in src/CMakeLists.txt src/loader/CMakeLists.txt tsl/src/CMakeLists.txt; do - substituteInPlace "$x" \ - --replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\"" - done - ''; + cmakeFlags = [ + "-DSEND_TELEMETRY_DEFAULT=OFF" + "-DREGRESS_CHECKS=OFF" + "-DTAP_CHECKS=OFF" + "-DAPACHE_ONLY=1" + ] ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; + + postPatch = '' + for x in CMakeLists.txt sql/CMakeLists.txt; do + if [ -f "$x" ]; then + substituteInPlace "$x" \ + --replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/postgresql/extension\"" + fi + done + + for x in src/CMakeLists.txt src/loader/CMakeLists.txt tsl/src/CMakeLists.txt; do + if [ -f "$x" ]; then + substituteInPlace "$x" \ + --replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\"" + fi + done + ''; - meta = with lib; { - description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; - homepage = "https://www.timescale.com/"; - changelog = "https://github.com/timescale/timescaledb/blob/${version}/CHANGELOG.md"; - platforms = postgresql.meta.platforms; - license = licenses.asl20; - broken = versionOlder postgresql.version "13"; + postInstall = '' + if [ -f $out/lib/timescaledb.so ]; then + mv $out/lib/timescaledb.so $out/lib/timescaledb-${version}.so + fi + if [ -f $out/share/postgresql/extension/timescaledb.control ]; then + mv $out/share/postgresql/extension/timescaledb.control $out/share/postgresql/extension/timescaledb--${version}.control + fi + ''; + + meta = with lib; { + description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; + homepage = "https://www.timescale.com/"; + changelog = "https://github.com/timescale/timescaledb/blob/${version}/CHANGELOG.md"; + license = licenses.postgresql; + inherit (postgresql.meta) platforms; + }; + }; + + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).timescaledb; + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash (value.revision or name)) supportedVersions + ); +in +pkgs.buildEnv { + name = pname; + paths = packages; + postBuild = '' + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + + # checks + (set -x + test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ + toString (numberOfVersions + 1) + }" + ) + ''; + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/versions.json b/nix/ext/versions.json index a5a289d45..756acb2b3 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -130,6 +130,20 @@ ], "hash": "sha256-Cpi2iASi1QJoED0Qs1dANqg/BNZTsz5S+pw8iYyW03Y=" } + }, + "timescaledb": { + "2.9.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-fvVSxDiGZAewyuQ2vZDb0I6tmlDXl6trjZp8+qDBtb8=" + }, + "2.16.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-sLxWdBmih9mgiO51zLLxn9uwJVYc5JVHJjSWoADoJ+w=" + } }, "vector": { "0.4.0": { diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix index f8795476e..54c674775 100644 --- a/nix/packages/postgres.nix +++ b/nix/packages/postgres.nix @@ -19,7 +19,6 @@ ourExtensions = [ ../ext/rum.nix ../ext/timescaledb.nix - ../ext/timescaledb-2.9.1.nix ../ext/pgroonga.nix ../ext/index_advisor.nix ../ext/wal2json.nix diff --git a/nix/tests/timescaledb.nix b/nix/tests/timescaledb.nix new file mode 100644 index 000000000..2978055e7 --- /dev/null +++ b/nix/tests/timescaledb.nix @@ -0,0 +1,100 @@ +{ self, pkgs }: +let + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: + self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/timescaledb-all"; + versions = (installedExtension "15").versions; + firstVersion = lib.head versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-timescaledb"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = "timescaledb"; + hostPkgs = pkgs; + nodes.server = + { ... }: + { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 13022; + guest.port = 22; + } + ]; + }; + services.openssh = { + enable = true; + }; + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIArkmq6Th79Z4klW6Urgi4phN8yq769/l/10jlE00tU9" + ]; + + services.postgresql = { + enable = true; + package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + settings = { + shared_preload_libraries = "timescaledb"; + }; + }; + + specialisation.postgresql15.configuration = { + services.postgresql = { + package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15); + }; + }; + }; + testScript = + { ... }: + '' + def run_sql(query): + return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() + + def check_upgrade_path(): + with subtest("Check timescaledb upgrade path"): + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS timescaledb;'") + run_sql(r"""CREATE EXTENSION timescaledb WITH VERSION \"${firstVersion}\";""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'timescaledb';""") + assert installed_version == "${firstVersion}", f"Expected timescaledb version ${firstVersion}, but found {installed_version}" + for version in [${lib.concatStringsSep ", " (map (s: ''"${s}"'') versions)}][1:]: + run_sql(f"""ALTER EXTENSION timescaledb UPDATE TO '{version}';""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'timescaledb';""") + assert installed_version == version, f"Expected timescaledb version {version}, but found {installed_version}" + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + check_upgrade_path() + ''; +} From b2fcade384e003ee667da6f0d518e248f42bc231 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 19 Sep 2025 08:50:23 -0400 Subject: [PATCH 06/22] feat: multiversion timescaledb --- .github/workflows/nix-build.yml | 42 +++++++++++++++++---------------- flake.lock | 21 ----------------- flake.nix | 3 --- nix/github-actions.nix | 18 -------------- 4 files changed, 22 insertions(+), 62 deletions(-) delete mode 100644 nix/github-actions.nix diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 7551a14fa..c2f383961 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -10,32 +10,23 @@ on: permissions: id-token: write - # required by dependent workflows + # required by testinfra-ami-build dependent workflows contents: write packages: write jobs: - nix-matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v30 - - id: set-matrix - name: Generate Nix Matrix - run: | - set -Eeu - matrix="$(nix eval --json '.#githubActions.matrix')" - echo "matrix=$matrix" >> "$GITHUB_OUTPUT" - build-run-image: - name: ${{ matrix.name }} (${{ matrix.system }}) - needs: nix-matrix - runs-on: ${{ matrix.os }} strategy: fail-fast: false - matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} + matrix: + include: + - runner: blacksmith-32vcpu-ubuntu-2404 + arch: amd64 + - runner: blacksmith-32vcpu-ubuntu-2404-arm + arch: arm64 + - runner: macos-latest-xlarge + arch: arm64 + runs-on: ${{ matrix.runner }} timeout-minutes: 180 steps: - name: Checkout Repo @@ -113,12 +104,23 @@ jobs: sudo rm -rf /tmp/* 2>/dev/null || true echo "=== AFTER CLEANUP ===" df -h - - run: nix build -L '.#${{ matrix.attr }}' + - name: Build psql bundle + run: > + nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48" + -- --skip-cached --no-nom ${{ matrix.runner == 'macos-latest-xlarge' && '--max-jobs 1' || '' }} + --flake ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')" env: AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }} + run-testinfra: + needs: build-run-image + if: ${{ success() }} + uses: ./.github/workflows/testinfra-ami-build.yml + secrets: + DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }} + run-tests: needs: build-run-image if: ${{ success() }} diff --git a/flake.lock b/flake.lock index b9a8b2f83..9d2865e1d 100644 --- a/flake.lock +++ b/flake.lock @@ -173,26 +173,6 @@ "type": "github" } }, - "nix-github-actions": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1737420293, - "narHash": "sha256-F1G5ifvqTpJq7fdkT34e/Jy9VCyzd5XfJ9TO8fHhJWE=", - "owner": "nix-community", - "repo": "nix-github-actions", - "rev": "f4158fa080ef4503c8f4c820967d946c2af31ec9", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nix-github-actions", - "type": "github" - } - }, "nix2container": { "inputs": { "flake-utils": "flake-utils_2", @@ -329,7 +309,6 @@ "git-hooks": "git-hooks", "nix-editor": "nix-editor", "nix-fast-build": "nix-fast-build", - "nix-github-actions": "nix-github-actions", "nix2container": "nix2container", "nixpkgs": "nixpkgs_4", "nixpkgs-go124": "nixpkgs-go124", diff --git a/flake.nix b/flake.nix index f91facd4b..db14dac9a 100644 --- a/flake.nix +++ b/flake.nix @@ -14,8 +14,6 @@ git-hooks.url = "github:cachix/git-hooks.nix"; git-hooks.inputs.nixpkgs.follows = "nixpkgs"; nixpkgs-go124.url = "github:Nixos/nixpkgs/d2ac4dfa61fba987a84a0a81555da57ae0b9a2b0"; - nix-github-actions.url = "github:nix-community/nix-github-actions"; - nix-github-actions.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = @@ -38,7 +36,6 @@ nix/nixpkgs.nix nix/packages nix/overlays - nix/github-actions.nix ]; }); } diff --git a/nix/github-actions.nix b/nix/github-actions.nix deleted file mode 100644 index 752f0b41a..000000000 --- a/nix/github-actions.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ inputs, ... }: -let - githubPlatforms = { - "x86_64-linux" = "large-linux-x86"; - "aarch64-linux" = "large-linux-arm"; - "aarch64-darwin" = "macos-latest-xlarge"; - }; -in -{ - flake.githubActions = inputs.nix-github-actions.lib.mkGithubMatrix { - checks = inputs.nixpkgs.lib.getAttrs [ - "x86_64-linux" - "aarch64-linux" - "aarch64-darwin" - ] inputs.self.checks; - platforms = githubPlatforms; - }; -} From 34b5f281a7d447c1f47a1007d6de43506e332295 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 19 Sep 2025 10:34:42 -0400 Subject: [PATCH 07/22] fix: refactor a bit to complete the extension --- nix/ext/tests/default.nix | 1 + nix/ext/timescaledb.nix | 54 +++++++++++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index afea82fc8..878b01933 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -186,6 +186,7 @@ builtins.listToAttrs ( "index_advisor" "pg_cron" "pg_net" + "timescaledb" "vector" "wrappers" ] diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index c8e224e9e..5fea738a7 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -1,5 +1,4 @@ { - pkgs, lib, stdenv, fetchFromGitHub, @@ -7,6 +6,9 @@ postgresql, openssl, libkrb5, + buildEnv, + makeWrapper, + switch-ext-version, }: let @@ -53,12 +55,28 @@ let done ''; - postInstall = '' - if [ -f $out/lib/timescaledb.so ]; then - mv $out/lib/timescaledb.so $out/lib/timescaledb-${version}.so + installPhase = '' + # Run cmake install first + cmake --install . --prefix=$out + + # TimescaleDB has two libraries: + # 1. timescaledb.so (loader) + # 2. timescaledb-VERSION.so (actual extension) + # Both need to be handled for multi-version support + + # Rename the loader to be version-specific + if [ -f $out/lib/timescaledb${postgresql.dlSuffix} ]; then + mv $out/lib/timescaledb${postgresql.dlSuffix} $out/lib/timescaledb-loader-${version}${postgresql.dlSuffix} fi + + # The versioned library (timescaledb-VERSION.so) is already correctly named + + # Create versioned control file with default_version removed and module_pathname pointing to symlink if [ -f $out/share/postgresql/extension/timescaledb.control ]; then - mv $out/share/postgresql/extension/timescaledb.control $out/share/postgresql/extension/timescaledb--${version}.control + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/timescaledb'|" \ + $out/share/postgresql/extension/timescaledb.control > $out/share/postgresql/extension/timescaledb--${version}.control + rm $out/share/postgresql/extension/timescaledb.control fi ''; @@ -66,7 +84,7 @@ let description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; homepage = "https://www.timescale.com/"; changelog = "https://github.com/timescale/timescaledb/blob/${version}/CHANGELOG.md"; - license = licenses.postgresql; + license = licenses.asl20; inherit (postgresql.meta) platforms; }; }; @@ -82,30 +100,40 @@ let lib.mapAttrs (name: value: build name value.hash (value.revision or name)) supportedVersions ); in -pkgs.buildEnv { +buildEnv { name = pname; paths = packages; + nativeBuildInputs = [ makeWrapper ]; postBuild = '' { echo "default_version = '${latestVersion}'" cat $out/share/postgresql/extension/${pname}--${latestVersion}.control } > $out/share/postgresql/extension/${pname}.control - ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} - # checks + # Create symlink for the loader + ln -sfn ${pname}-loader-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + + # The versioned library symlink (timescaledb-VERSION.so files are already in place) + + # checks - adjust count since we have both loader and versioned files (set -x - test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ - toString (numberOfVersions + 1) - }" + test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" -gt 0 ) + makeWrapper ${lib.getExe switch-ext-version} $out/bin/switch_timescaledb_version \ + --prefix EXT_WRAPPER : "$out" --prefix EXT_NAME : "${pname}" + ''; pathsToLink = [ "/lib" "/share/postgresql/extension" ]; passthru = { - inherit versions numberOfVersions; + inherit versions numberOfVersions switch-ext-version; pname = "${pname}-all"; + hasBackgroundWorker = true; + defaultSettings = { + shared_preload_libraries = [ "timescaledb" ]; + }; version = "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; From 28659b038051a1800f5e0d109028db6e5d9f36fb Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 19 Sep 2025 10:38:54 -0400 Subject: [PATCH 08/22] test: remove older version of integration test --- nix/tests/timescaledb.nix | 100 -------------------------------------- 1 file changed, 100 deletions(-) delete mode 100644 nix/tests/timescaledb.nix diff --git a/nix/tests/timescaledb.nix b/nix/tests/timescaledb.nix deleted file mode 100644 index 2978055e7..000000000 --- a/nix/tests/timescaledb.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ self, pkgs }: -let - inherit (pkgs) lib; - installedExtension = - postgresMajorVersion: - self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/timescaledb-all"; - versions = (installedExtension "15").versions; - firstVersion = lib.head versions; - postgresqlWithExtension = - postgresql: - let - majorVersion = lib.versions.major postgresql.version; - pkg = pkgs.buildEnv { - name = "postgresql-${majorVersion}-timescaledb"; - paths = [ - postgresql - postgresql.lib - (installedExtension majorVersion) - ]; - passthru = { - inherit (postgresql) version psqlSchema; - lib = pkg; - withPackages = _: pkg; - }; - nativeBuildInputs = [ pkgs.makeWrapper ]; - pathsToLink = [ - "/" - "/bin" - "/lib" - ]; - postBuild = '' - wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib - wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib - wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib - ''; - }; - in - pkg; -in -self.inputs.nixpkgs.lib.nixos.runTest { - name = "timescaledb"; - hostPkgs = pkgs; - nodes.server = - { ... }: - { - virtualisation = { - forwardPorts = [ - { - from = "host"; - host.port = 13022; - guest.port = 22; - } - ]; - }; - services.openssh = { - enable = true; - }; - users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIArkmq6Th79Z4klW6Urgi4phN8yq769/l/10jlE00tU9" - ]; - - services.postgresql = { - enable = true; - package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; - settings = { - shared_preload_libraries = "timescaledb"; - }; - }; - - specialisation.postgresql15.configuration = { - services.postgresql = { - package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15); - }; - }; - }; - testScript = - { ... }: - '' - def run_sql(query): - return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() - - def check_upgrade_path(): - with subtest("Check timescaledb upgrade path"): - server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS timescaledb;'") - run_sql(r"""CREATE EXTENSION timescaledb WITH VERSION \"${firstVersion}\";""") - installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'timescaledb';""") - assert installed_version == "${firstVersion}", f"Expected timescaledb version ${firstVersion}, but found {installed_version}" - for version in [${lib.concatStringsSep ", " (map (s: ''"${s}"'') versions)}][1:]: - run_sql(f"""ALTER EXTENSION timescaledb UPDATE TO '{version}';""") - installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'timescaledb';""") - assert installed_version == version, f"Expected timescaledb version {version}, but found {installed_version}" - - start_all() - - server.wait_for_unit("multi-user.target") - server.wait_for_unit("postgresql.service") - - check_upgrade_path() - ''; -} From 578af457ceea3622be4b7b34282fca29a6723a5b Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 19 Sep 2025 11:02:20 -0400 Subject: [PATCH 09/22] fix: make sure integration tests do not run timescaledb tests on pg > 15 --- nix/ext/tests/default.nix | 104 ++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 44 deletions(-) diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index 878b01933..351239a02 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -10,6 +10,8 @@ let let pname = extension_name; inherit (pkgs) lib; + # Special case for timescaledb-apache: only test with PostgreSQL 15 + isTimescaledb = extension_name == "timescaledb-apache"; installedExtension = postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; @@ -44,7 +46,8 @@ let in pkg; psql_15 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; - psql_17 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; + psql_17 = + if isTimescaledb then null else postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; in self.inputs.nixpkgs.lib.nixos.runTest { name = pname; @@ -80,42 +83,44 @@ let networking.firewall.allowedTCPPorts = [ config.services.postgresql.settings.port ]; - specialisation.postgresql17.configuration = { - services.postgresql = { - package = lib.mkForce psql_17; - }; + specialisation = lib.optionalAttrs (!isTimescaledb) { + postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce psql_17; + }; - systemd.services.postgresql-migrate = { - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - User = "postgres"; - Group = "postgres"; - StateDirectory = "postgresql"; - WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + oldPostgresql = psql_15; + newPostgresql = psql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; }; - script = - let - oldPostgresql = psql_15; - newPostgresql = psql_17; - oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; - newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; - in - '' - if [[ ! -d ${newDataDir} ]]; then - install -d -m 0700 -o postgres -g postgres "${newDataDir}" - ${newPostgresql}/bin/initdb -D "${newDataDir}" - ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ - --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" - else - echo "${newDataDir} already exists" - fi - ''; - }; - systemd.services.postgresql = { - after = [ "postgresql-migrate.service" ]; - requires = [ "postgresql-migrate.service" ]; + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; }; }; }; @@ -127,7 +132,12 @@ let '' versions = { "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], - "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], + ${ + if isTimescaledb then + "" + else + ''"17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}],'' + } } extension_name = "${pname}" support_upgrade = True @@ -156,16 +166,22 @@ let with subtest("Test switch_${pname}_version"): test.check_switch_extension_with_background_worker(Path("${psql_15}/lib/${pname}.so"), "15") - with subtest("switch to postgresql 17"): - server.succeed( - f"{pg17_configuration}/bin/switch-to-configuration test >&2" - ) + ${ + if isTimescaledb then + "" + else + '' + with subtest("switch to postgresql 17"): + server.succeed( + f"{pg17_configuration}/bin/switch-to-configuration test >&2" + ) - with subtest("Check last version of the extension after upgrade"): - test.assert_version_matches(last_version) + with subtest("Check last version of the extension after upgrade"): + test.assert_version_matches(last_version) - with subtest("Check upgrade path with postgresql 17"): - test.check_upgrade_path("17") + with subtest("Check upgrade path with postgresql 17"): + test.check_upgrade_path("17")'' + } ''; }; in @@ -186,7 +202,7 @@ builtins.listToAttrs ( "index_advisor" "pg_cron" "pg_net" - "timescaledb" + "timescaledb-apache" "vector" "wrappers" ] From 638c0b4218b85ce463f5228ea174e9099fa3b5ff Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 19 Sep 2025 11:26:26 -0400 Subject: [PATCH 10/22] test: revert to use test in nix/tests for timescale --- nix/ext/tests/default.nix | 104 ++++++++++++++++---------------------- nix/tests/timescaledb.nix | 100 ++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+), 60 deletions(-) create mode 100644 nix/tests/timescaledb.nix diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index 351239a02..878b01933 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -10,8 +10,6 @@ let let pname = extension_name; inherit (pkgs) lib; - # Special case for timescaledb-apache: only test with PostgreSQL 15 - isTimescaledb = extension_name == "timescaledb-apache"; installedExtension = postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; @@ -46,8 +44,7 @@ let in pkg; psql_15 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; - psql_17 = - if isTimescaledb then null else postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; + psql_17 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; in self.inputs.nixpkgs.lib.nixos.runTest { name = pname; @@ -83,44 +80,42 @@ let networking.firewall.allowedTCPPorts = [ config.services.postgresql.settings.port ]; - specialisation = lib.optionalAttrs (!isTimescaledb) { - postgresql17.configuration = { - services.postgresql = { - package = lib.mkForce psql_17; - }; + specialisation.postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce psql_17; + }; - systemd.services.postgresql-migrate = { - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - User = "postgres"; - Group = "postgres"; - StateDirectory = "postgresql"; - WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; - }; - script = - let - oldPostgresql = psql_15; - newPostgresql = psql_17; - oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; - newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; - in - '' - if [[ ! -d ${newDataDir} ]]; then - install -d -m 0700 -o postgres -g postgres "${newDataDir}" - ${newPostgresql}/bin/initdb -D "${newDataDir}" - ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ - --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" - else - echo "${newDataDir} already exists" - fi - ''; + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; }; + script = + let + oldPostgresql = psql_15; + newPostgresql = psql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; + }; - systemd.services.postgresql = { - after = [ "postgresql-migrate.service" ]; - requires = [ "postgresql-migrate.service" ]; - }; + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; }; }; }; @@ -132,12 +127,7 @@ let '' versions = { "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], - ${ - if isTimescaledb then - "" - else - ''"17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}],'' - } + "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], } extension_name = "${pname}" support_upgrade = True @@ -166,22 +156,16 @@ let with subtest("Test switch_${pname}_version"): test.check_switch_extension_with_background_worker(Path("${psql_15}/lib/${pname}.so"), "15") - ${ - if isTimescaledb then - "" - else - '' - with subtest("switch to postgresql 17"): - server.succeed( - f"{pg17_configuration}/bin/switch-to-configuration test >&2" - ) + with subtest("switch to postgresql 17"): + server.succeed( + f"{pg17_configuration}/bin/switch-to-configuration test >&2" + ) - with subtest("Check last version of the extension after upgrade"): - test.assert_version_matches(last_version) + with subtest("Check last version of the extension after upgrade"): + test.assert_version_matches(last_version) - with subtest("Check upgrade path with postgresql 17"): - test.check_upgrade_path("17")'' - } + with subtest("Check upgrade path with postgresql 17"): + test.check_upgrade_path("17") ''; }; in @@ -202,7 +186,7 @@ builtins.listToAttrs ( "index_advisor" "pg_cron" "pg_net" - "timescaledb-apache" + "timescaledb" "vector" "wrappers" ] diff --git a/nix/tests/timescaledb.nix b/nix/tests/timescaledb.nix new file mode 100644 index 000000000..2978055e7 --- /dev/null +++ b/nix/tests/timescaledb.nix @@ -0,0 +1,100 @@ +{ self, pkgs }: +let + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: + self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/timescaledb-all"; + versions = (installedExtension "15").versions; + firstVersion = lib.head versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-timescaledb"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = "timescaledb"; + hostPkgs = pkgs; + nodes.server = + { ... }: + { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 13022; + guest.port = 22; + } + ]; + }; + services.openssh = { + enable = true; + }; + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIArkmq6Th79Z4klW6Urgi4phN8yq769/l/10jlE00tU9" + ]; + + services.postgresql = { + enable = true; + package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + settings = { + shared_preload_libraries = "timescaledb"; + }; + }; + + specialisation.postgresql15.configuration = { + services.postgresql = { + package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15); + }; + }; + }; + testScript = + { ... }: + '' + def run_sql(query): + return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() + + def check_upgrade_path(): + with subtest("Check timescaledb upgrade path"): + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS timescaledb;'") + run_sql(r"""CREATE EXTENSION timescaledb WITH VERSION \"${firstVersion}\";""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'timescaledb';""") + assert installed_version == "${firstVersion}", f"Expected timescaledb version ${firstVersion}, but found {installed_version}" + for version in [${lib.concatStringsSep ", " (map (s: ''"${s}"'') versions)}][1:]: + run_sql(f"""ALTER EXTENSION timescaledb UPDATE TO '{version}';""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'timescaledb';""") + assert installed_version == version, f"Expected timescaledb version {version}, but found {installed_version}" + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + check_upgrade_path() + ''; +} From 7db6348cbfa1f81df47378a4ca8c38f44e30f368 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 19 Sep 2025 11:43:57 -0400 Subject: [PATCH 11/22] fix: integrtion tests --- nix/ext/tests/default.nix | 1 - nix/tests/timescaledb.nix | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index 878b01933..afea82fc8 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -186,7 +186,6 @@ builtins.listToAttrs ( "index_advisor" "pg_cron" "pg_net" - "timescaledb" "vector" "wrappers" ] diff --git a/nix/tests/timescaledb.nix b/nix/tests/timescaledb.nix index 2978055e7..ab9e481b0 100644 --- a/nix/tests/timescaledb.nix +++ b/nix/tests/timescaledb.nix @@ -90,11 +90,11 @@ self.inputs.nixpkgs.lib.nixos.runTest { installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'timescaledb';""") assert installed_version == version, f"Expected timescaledb version {version}, but found {installed_version}" - start_all() + start_all() - server.wait_for_unit("multi-user.target") - server.wait_for_unit("postgresql.service") + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") - check_upgrade_path() + check_upgrade_path() ''; } From 5466049c331d0fc6a558cbffd754aae918bd0cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Fri, 19 Sep 2025 17:57:21 +0200 Subject: [PATCH 12/22] Move timescaledb nixos test to nix/ext/tests --- nix/{ => ext}/tests/timescaledb.nix | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename nix/{ => ext}/tests/timescaledb.nix (100%) diff --git a/nix/tests/timescaledb.nix b/nix/ext/tests/timescaledb.nix similarity index 100% rename from nix/tests/timescaledb.nix rename to nix/ext/tests/timescaledb.nix From f92194142cb34e5b5970b1ed28c37160aaaa9b10 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 19 Sep 2025 13:35:54 -0400 Subject: [PATCH 13/22] chore: bump for test --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index a32c56d7a..562804777 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.026-orioledb" - postgres17: "17.6.1.005" - postgres15: "15.14.1.005" + postgresorioledb-17: "17.5.1.026-orioledb-timescale-1" + postgres17: "17.6.1.005-timescale-1" + postgres15: "15.14.1.005-timescale-1" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 90c5e4bd17892eb6eaa5cbf0c19bc51ec3001eda Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 22 Sep 2025 11:38:26 -0400 Subject: [PATCH 14/22] fix: need to also handle timescaledb-loader --- nix/packages/switch-ext-version.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nix/packages/switch-ext-version.nix b/nix/packages/switch-ext-version.nix index 1b0354a26..e100197b8 100644 --- a/nix/packages/switch-ext-version.nix +++ b/nix/packages/switch-ext-version.nix @@ -54,6 +54,14 @@ writeShellApplication { # Update library symlink ln -sfnv "$EXT_LIB_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME${postgresql.dlSuffix}" + # Handle timescaledb-loader symlink (specific to timescaledb) + if [ "$EXT_NAME" = "timescaledb" ]; then + EXT_LOADER_TO_USE="$EXT_WRAPPER_LIB/$EXT_NAME-loader-$VERSION${postgresql.dlSuffix}" + if [ -f "$EXT_LOADER_TO_USE" ]; then + ln -sfnv "$EXT_LOADER_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME-loader${postgresql.dlSuffix}" + fi + fi + # Update control file EXT_WRAPPER_SHARE="$EXT_WRAPPER/share/postgresql/extension" echo "default_version = '$VERSION'" > "$EXT_WRAPPER_SHARE/$EXT_NAME.control" From 7cce2c249f90e4378956ad262dc68d8bf908def6 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 22 Sep 2025 14:17:06 -0400 Subject: [PATCH 15/22] chore: bump version for fix --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 562804777..10cd48a79 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.026-orioledb-timescale-1" - postgres17: "17.6.1.005-timescale-1" - postgres15: "15.14.1.005-timescale-1" + postgresorioledb-17: "17.5.1.026-orioledb-timescale-2" + postgres17: "17.6.1.005-timescale-2" + postgres15: "15.14.1.005-timescale-2" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 5cbce8f080be38e9baef75e576d8ab33aa7bb981 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 22 Sep 2025 15:31:47 -0400 Subject: [PATCH 16/22] fix: didn't need "loader" --- nix/ext/timescaledb.nix | 4 ++-- nix/packages/switch-ext-version.nix | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index 5fea738a7..2c1c7c271 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -66,7 +66,7 @@ let # Rename the loader to be version-specific if [ -f $out/lib/timescaledb${postgresql.dlSuffix} ]; then - mv $out/lib/timescaledb${postgresql.dlSuffix} $out/lib/timescaledb-loader-${version}${postgresql.dlSuffix} + mv $out/lib/timescaledb${postgresql.dlSuffix} $out/lib/timescaledb-${version}${postgresql.dlSuffix} fi # The versioned library (timescaledb-VERSION.so) is already correctly named @@ -111,7 +111,7 @@ buildEnv { } > $out/share/postgresql/extension/${pname}.control # Create symlink for the loader - ln -sfn ${pname}-loader-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} # The versioned library symlink (timescaledb-VERSION.so files are already in place) diff --git a/nix/packages/switch-ext-version.nix b/nix/packages/switch-ext-version.nix index e100197b8..1b0354a26 100644 --- a/nix/packages/switch-ext-version.nix +++ b/nix/packages/switch-ext-version.nix @@ -54,14 +54,6 @@ writeShellApplication { # Update library symlink ln -sfnv "$EXT_LIB_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME${postgresql.dlSuffix}" - # Handle timescaledb-loader symlink (specific to timescaledb) - if [ "$EXT_NAME" = "timescaledb" ]; then - EXT_LOADER_TO_USE="$EXT_WRAPPER_LIB/$EXT_NAME-loader-$VERSION${postgresql.dlSuffix}" - if [ -f "$EXT_LOADER_TO_USE" ]; then - ln -sfnv "$EXT_LOADER_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME-loader${postgresql.dlSuffix}" - fi - fi - # Update control file EXT_WRAPPER_SHARE="$EXT_WRAPPER/share/postgresql/extension" echo "default_version = '$VERSION'" > "$EXT_WRAPPER_SHARE/$EXT_NAME.control" From bdfc3e10f6d125029164d3d9b25b2d7907fe8f09 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 22 Sep 2025 15:34:01 -0400 Subject: [PATCH 17/22] chore: bump version for testing --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 10cd48a79..bdaa0b48d 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.026-orioledb-timescale-2" - postgres17: "17.6.1.005-timescale-2" - postgres15: "15.14.1.005-timescale-2" + postgresorioledb-17: "17.5.1.026-orioledb-timescale-3" + postgres17: "17.6.1.005-timescale-3" + postgres15: "15.14.1.005-timescale-3" # Non Postgres Extensions pgbouncer_release: "1.19.0" From c0e5f3fcf93af5f93f4bae8497b8948fb364f5b0 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 22 Sep 2025 16:16:13 -0400 Subject: [PATCH 18/22] fix: does need loader --- nix/ext/timescaledb.nix | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index 2c1c7c271..4c51aadb1 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -59,14 +59,13 @@ let # Run cmake install first cmake --install . --prefix=$out - # TimescaleDB has two libraries: - # 1. timescaledb.so (loader) - # 2. timescaledb-VERSION.so (actual extension) - # Both need to be handled for multi-version support + # TimescaleDB creates two libraries: + # 1. timescaledb.so (loader) -> rename to timescaledb--loader.so + # 2. timescaledb-.so (actual extension) -> keep as is - # Rename the loader to be version-specific + # Rename the loader library to be version-specific if [ -f $out/lib/timescaledb${postgresql.dlSuffix} ]; then - mv $out/lib/timescaledb${postgresql.dlSuffix} $out/lib/timescaledb-${version}${postgresql.dlSuffix} + mv $out/lib/timescaledb${postgresql.dlSuffix} $out/lib/timescaledb-${version}-loader${postgresql.dlSuffix} fi # The versioned library (timescaledb-VERSION.so) is already correctly named @@ -110,12 +109,12 @@ buildEnv { cat $out/share/postgresql/extension/${pname}--${latestVersion}.control } > $out/share/postgresql/extension/${pname}.control - # Create symlink for the loader - ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + # Create symlink from the latest versioned loader to timescaledb.so + ln -sfn ${pname}-${latestVersion}-loader${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} - # The versioned library symlink (timescaledb-VERSION.so files are already in place) + # The versioned extension libraries (timescaledb-VERSION.so) are already in place - # checks - adjust count since we have both loader and versioned files + # checks - we should have loader files and versioned extension files (set -x test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" -gt 0 ) From 33d6a4f97b89a2ceb2feaa39335818dc3c5c48ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 22 Sep 2025 20:44:35 +0200 Subject: [PATCH 19/22] feat: switch both timescaledb and its loader when switching versions Also reuse default tests defined in lib.py to test extension upgrade paths and switching extension versions. --- nix/ext/tests/lib.py | 6 +-- nix/ext/tests/timescaledb.nix | 60 +++++++++-------------------- nix/ext/timescaledb.nix | 21 ++++++++-- nix/packages/switch-ext-version.nix | 6 +++ 4 files changed, 45 insertions(+), 48 deletions(-) diff --git a/nix/ext/tests/lib.py b/nix/ext/tests/lib.py index 1e3956c9b..35c5b0e04 100644 --- a/nix/ext/tests/lib.py +++ b/nix/ext/tests/lib.py @@ -147,7 +147,7 @@ def check_switch_extension_with_background_worker( ) last_version = available_versions[-1] assert ext_version.endswith( - f"{self.extension_name}-{last_version}.so" + f"{last_version}.so" ), f"Expected {self.extension_name} version {last_version}, but found {ext_version}" # Switch to the first version @@ -157,7 +157,7 @@ def check_switch_extension_with_background_worker( # Check that we are using the first version now ext_version = self.vm.succeed(f"readlink -f {extension_lib_path}").strip() assert ext_version.endswith( - f"{self.extension_name}-{first_version}.so" + f"{first_version}.so" ), f"Expected {self.extension_name} version {first_version}, but found {ext_version}" # Switch to the first version @@ -165,5 +165,5 @@ def check_switch_extension_with_background_worker( # Check that we are using the last version now ext_version = self.vm.succeed(f"readlink -f {extension_lib_path}").strip() assert ext_version.endswith( - f"{self.extension_name}-{last_version}.so" + f"{last_version}.so" ), f"Expected {self.extension_name} version {last_version}, but found {ext_version}" diff --git a/nix/ext/tests/timescaledb.nix b/nix/ext/tests/timescaledb.nix index ab9e481b0..597fe9e0d 100644 --- a/nix/ext/tests/timescaledb.nix +++ b/nix/ext/tests/timescaledb.nix @@ -1,17 +1,16 @@ { self, pkgs }: let + pname = "timescaledb"; inherit (pkgs) lib; installedExtension = - postgresMajorVersion: - self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/timescaledb-all"; + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; versions = (installedExtension "15").versions; - firstVersion = lib.head versions; postgresqlWithExtension = postgresql: let majorVersion = lib.versions.major postgresql.version; pkg = pkgs.buildEnv { - name = "postgresql-${majorVersion}-timescaledb"; + name = "postgresql-${majorVersion}-${pname}"; paths = [ postgresql postgresql.lib @@ -36,6 +35,7 @@ let }; in pkg; + psql_15 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; in self.inputs.nixpkgs.lib.nixos.runTest { name = "timescaledb"; @@ -43,58 +43,36 @@ self.inputs.nixpkgs.lib.nixos.runTest { nodes.server = { ... }: { - virtualisation = { - forwardPorts = [ - { - from = "host"; - host.port = 13022; - guest.port = 22; - } - ]; - }; - services.openssh = { - enable = true; - }; - users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIArkmq6Th79Z4klW6Urgi4phN8yq769/l/10jlE00tU9" - ]; - services.postgresql = { enable = true; - package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + package = (postgresqlWithExtension psql_15); settings = { shared_preload_libraries = "timescaledb"; }; }; - - specialisation.postgresql15.configuration = { - services.postgresql = { - package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15); - }; - }; }; testScript = { ... }: '' - def run_sql(query): - return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() - - def check_upgrade_path(): - with subtest("Check timescaledb upgrade path"): - server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS timescaledb;'") - run_sql(r"""CREATE EXTENSION timescaledb WITH VERSION \"${firstVersion}\";""") - installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'timescaledb';""") - assert installed_version == "${firstVersion}", f"Expected timescaledb version ${firstVersion}, but found {installed_version}" - for version in [${lib.concatStringsSep ", " (map (s: ''"${s}"'') versions)}][1:]: - run_sql(f"""ALTER EXTENSION timescaledb UPDATE TO '{version}';""") - installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'timescaledb';""") - assert installed_version == version, f"Expected timescaledb version {version}, but found {installed_version}" + ${builtins.readFile ./lib.py} start_all() server.wait_for_unit("multi-user.target") server.wait_for_unit("postgresql.service") - check_upgrade_path() + versions = { + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') versions)}], + } + extension_name = "${pname}" + support_upgrade = True + + test = PostgresExtensionTest(server, extension_name, versions, support_upgrade) + + with subtest("Check upgrade path with postgresql 15"): + test.check_upgrade_path("15") + + with subtest("Test switch_${pname}_version"): + test.check_switch_extension_with_background_worker(Path("${psql_15}/lib/${pname}.so"), "15") ''; } diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index 4c51aadb1..2ac328306 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -9,6 +9,8 @@ buildEnv, makeWrapper, switch-ext-version, + coreutils, + writeShellApplication, }: let @@ -65,7 +67,7 @@ let # Rename the loader library to be version-specific if [ -f $out/lib/timescaledb${postgresql.dlSuffix} ]; then - mv $out/lib/timescaledb${postgresql.dlSuffix} $out/lib/timescaledb-${version}-loader${postgresql.dlSuffix} + mv $out/lib/timescaledb${postgresql.dlSuffix} $out/lib/timescaledb-loader-${version}${postgresql.dlSuffix} fi # The versioned library (timescaledb-VERSION.so) is already correctly named @@ -98,6 +100,16 @@ let packages = builtins.attrValues ( lib.mapAttrs (name: value: build name value.hash (value.revision or name)) supportedVersions ); + switch-timescaledb-loader = writeShellApplication { + name = "switch_timescaledb_loader"; + runtimeInputs = [ coreutils ]; + text = '' + EXT_LOADER_TO_USE="$EXT_WRAPPER_LIB/$EXT_NAME-loader-$VERSION${postgresql.dlSuffix}" + if [ -f "$EXT_LOADER_TO_USE" ]; then + ln -sfnv "$EXT_LOADER_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME-loader${postgresql.dlSuffix}" + fi + ''; + }; in buildEnv { name = pname; @@ -110,7 +122,7 @@ buildEnv { } > $out/share/postgresql/extension/${pname}.control # Create symlink from the latest versioned loader to timescaledb.so - ln -sfn ${pname}-${latestVersion}-loader${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + ln -sfn ${pname}-loader-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} # The versioned extension libraries (timescaledb-VERSION.so) are already in place @@ -119,13 +131,14 @@ buildEnv { test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" -gt 0 ) makeWrapper ${lib.getExe switch-ext-version} $out/bin/switch_timescaledb_version \ - --prefix EXT_WRAPPER : "$out" --prefix EXT_NAME : "${pname}" - + --prefix EXT_WRAPPER : "$out" --prefix EXT_NAME : "${pname}" --prefix EXTRA_STEPS : ${lib.getExe switch-timescaledb-loader} ''; + pathsToLink = [ "/lib" "/share/postgresql/extension" ]; + passthru = { inherit versions numberOfVersions switch-ext-version; pname = "${pname}-all"; diff --git a/nix/packages/switch-ext-version.nix b/nix/packages/switch-ext-version.nix index 1b0354a26..e3d211bbb 100644 --- a/nix/packages/switch-ext-version.nix +++ b/nix/packages/switch-ext-version.nix @@ -54,6 +54,12 @@ writeShellApplication { # Update library symlink ln -sfnv "$EXT_LIB_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME${postgresql.dlSuffix}" + # Handle extension specific steps + if [ -x "''${EXTRA_STEPS:-}" ]; then + #shellcheck disable=SC1090 + source "''${EXTRA_STEPS}" + fi + # Update control file EXT_WRAPPER_SHARE="$EXT_WRAPPER/share/postgresql/extension" echo "default_version = '$VERSION'" > "$EXT_WRAPPER_SHARE/$EXT_NAME.control" From eb7407a061c262f815ffe0d9a0b532fbf531926d Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 22 Sep 2025 18:53:02 -0400 Subject: [PATCH 20/22] chore: bump to test --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index bdaa0b48d..54dcda833 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.026-orioledb-timescale-3" - postgres17: "17.6.1.005-timescale-3" - postgres15: "15.14.1.005-timescale-3" + postgresorioledb-17: "17.5.1.026-orioledb-timescale-4" + postgres17: "17.6.1.005-timescale-4" + postgres15: "15.14.1.005-timescale-4" # Non Postgres Extensions pgbouncer_release: "1.19.0" From c7604f1aa810aa8626103048f1ee1368a4ef3bae Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 23 Sep 2025 10:19:49 -0400 Subject: [PATCH 21/22] fix: must symlink to timescaledb.so on switch --- ansible/vars.yml | 6 +++--- nix/ext/timescaledb.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 54dcda833..2394e3f04 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.026-orioledb-timescale-4" - postgres17: "17.6.1.005-timescale-4" - postgres15: "15.14.1.005-timescale-4" + postgresorioledb-17: "17.5.1.026-orioledb-timescale-5" + postgres17: "17.6.1.005-timescale-5" + postgres15: "15.14.1.005-timescale-5" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index 2ac328306..a58e8e2b4 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -106,7 +106,7 @@ let text = '' EXT_LOADER_TO_USE="$EXT_WRAPPER_LIB/$EXT_NAME-loader-$VERSION${postgresql.dlSuffix}" if [ -f "$EXT_LOADER_TO_USE" ]; then - ln -sfnv "$EXT_LOADER_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME-loader${postgresql.dlSuffix}" + ln -sfnv "$EXT_LOADER_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME${postgresql.dlSuffix}" fi ''; }; From 24d7bc25a849ea4116a007390711130970245022 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 23 Sep 2025 11:40:39 -0400 Subject: [PATCH 22/22] chore: bump for release --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 2394e3f04..742527b7f 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.026-orioledb-timescale-5" - postgres17: "17.6.1.005-timescale-5" - postgres15: "15.14.1.005-timescale-5" + postgresorioledb-17: "17.5.1.027-orioledb" + postgres17: "17.6.1.006" + postgres15: "15.14.1.006" # Non Postgres Extensions pgbouncer_release: "1.19.0"