Skip to content

Commit 43ebd7f

Browse files
committed
feat(pg_tle): use default nixos extension test
And run pg_regress tests for pg_tle as part of the unified extension tests
1 parent 155b3f4 commit 43ebd7f

File tree

3 files changed

+12
-162
lines changed

3 files changed

+12
-162
lines changed

nix/ext/pg_tle.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ buildEnv {
102102
passthru = {
103103
inherit versions numberOfVersions;
104104
pname = "${pname}-all";
105+
defaultSettings = {
106+
shared_preload_libraries = [ "pg_tle" ];
107+
};
105108
version =
106109
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
107110
};

nix/ext/tests/default.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ let
8383
specialisation.postgresql17.configuration = {
8484
services.postgresql = {
8585
package = lib.mkForce psql_17;
86+
settings = (installedExtension "17").defaultSettings or { };
8687
};
8788

8889
systemd.services.postgresql-migrate = {
@@ -106,7 +107,13 @@ let
106107
install -d -m 0700 -o postgres -g postgres "${newDataDir}"
107108
${newPostgresql}/bin/initdb -D "${newDataDir}"
108109
${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \
109-
--old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin"
110+
--old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" \
111+
${
112+
if config.services.postgresql.settings.shared_preload_libraries != null then
113+
" --old-options='-c shared_preload_libraries=${config.services.postgresql.settings.shared_preload_libraries}' --new-options='-c shared_preload_libraries=${config.services.postgresql.settings.shared_preload_libraries}'"
114+
else
115+
""
116+
}
110117
else
111118
echo "${newDataDir} already exists"
112119
fi
@@ -206,6 +213,7 @@ builtins.listToAttrs (
206213
"pg_graphql"
207214
"pg_jsonschema"
208215
"pg_net"
216+
"pg_tle"
209217
"vector"
210218
"wrappers"
211219
]

nix/ext/tests/pg_tle.nix

Lines changed: 0 additions & 161 deletions
This file was deleted.

0 commit comments

Comments
 (0)