From 70b51d8d17216ef6c4fdd073254899f1e8858bc9 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Mon, 22 Jan 2024 04:20:00 +0000 Subject: [PATCH] postgresqlTestHook: add postgresqlExtraSettings variable Add `postgresqlExtraSettings` to allow to setup the `postgresql.conf`. This would be useful in cases where we need to set `shared_preload_libraries`. --- doc/hooks/postgresql-test-hook.section.md | 1 + .../setup-hooks/postgresql-test-hook/postgresql-test-hook.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/hooks/postgresql-test-hook.section.md b/doc/hooks/postgresql-test-hook.section.md index 8b37ca1e4b3e..59d7f7a644c9 100644 --- a/doc/hooks/postgresql-test-hook.section.md +++ b/doc/hooks/postgresql-test-hook.section.md @@ -45,6 +45,7 @@ Bash-only variables: - `postgresqlTestSetupCommands`: bash commands to run after database start, defaults to running `$postgresqlTestSetupSQL` as database administrator. - `postgresqlEnableTCP`: set to `1` to enable TCP listening. Flaky; not recommended. - `postgresqlStartCommands`: defaults to `pg_ctl start`. + - `postgresqlExtraSettings`: Additional configuration to add to `postgresql.conf` ## Hooks {#sec-postgresqlTestHook-hooks} diff --git a/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh b/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh index 3eec67d60feb..d09153b2d644 100644 --- a/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh +++ b/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh @@ -56,6 +56,8 @@ EOF echo 'initializing postgresql' initdb -U postgres + echo "$postgresqlExtraSettings" >>"$PGDATA/postgresql.conf" + # Move the socket echo "unix_socket_directories = '$NIX_BUILD_TOP/run/postgresql'" >>"$PGDATA/postgresql.conf"