Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile-15
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ RUN sed -i \
-e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
-e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
-e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" \
-e "s|^summarize_wal = on|#&|g" /etc/postgresql/postgresql.conf && \
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
chown -R postgres:postgres /etc/postgresql-custom
Expand Down
3 changes: 2 additions & 1 deletion ansible/files/postgresql_config/postgresql.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ wal_level = logical # minimal, replica, or logical
#wal_writer_delay = 200ms # 1-10000 milliseconds
#wal_writer_flush_after = 1MB # measured in pages, 0 disables
#wal_skip_threshold = 2MB

summarize_wal = on # run WAL summarizer for 17 and up
#wal_summary_keep_time = '10d' # when to remove old summary files; 0 = never
#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000

Expand Down
7 changes: 7 additions & 0 deletions ansible/tasks/setup-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@
loop_control:
loop_var: 'pg_config_item'

- name: Disable summarize_wal on PG15 (GUC only exists from PG17)
when: psql_version == 'psql_15'
ansible.builtin.replace:
path: '/etc/postgresql/postgresql.conf'
regexp: '^summarize_wal = on'
replace: '#summarize_wal = on'

- name: Set data_directory to canonical path on data volume
ansible.builtin.lineinfile:
path: '/etc/postgresql/postgresql.conf'
Expand Down
1 change: 1 addition & 0 deletions nix/checks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
echo "port = ${pgPort}"
echo "session_preload_libraries = 'supautils'"
echo "dynamic_library_path = '${supautils}/lib:\$libdir'"
${lib.optionalString (pgpkg.version != "15") ''echo "summarize_wal = on"''}
} >> "$PGTAP_CLUSTER"/postgresql.conf
echo "host all all 127.0.0.1/32 trust" >> "$PGTAP_CLUSTER/pg_hba.conf"
log info "Checking shared_preload_libraries setting:"
Expand Down
6 changes: 6 additions & 0 deletions nix/tests/expected/z_17_wal_summarize.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT (SELECT setting FROM pg_settings WHERE name = 'summarize_wal') = 'on' AS summarize_wal_default_ok;
summarize_wal_default_ok
--------------------------
t
(1 row)

1 change: 1 addition & 0 deletions nix/tests/sql/z_17_wal_summarize.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT (SELECT setting FROM pg_settings WHERE name = 'summarize_wal') = 'on' AS summarize_wal_default_ok;
5 changes: 5 additions & 0 deletions nix/tools/run-server.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ session_preload_libraries = 'supautils'" \
-e "s|include_dir = '/etc/postgresql-custom/conf.d'|include_dir = '$DATDIR/conf.d'|" \
"$PSQL_CONF_FILE" > "$DATDIR/postgresql.conf"

# summarize_wal is PostgreSQL 17+; PG15 refuses to start on an unknown GUC
if [ "$VERSION" == "15" ]; then
perl -pi -e 's/^summarize_wal = on/#$&/' "$DATDIR/postgresql.conf"
fi

# Function to configure OrioleDB specific settings
orioledb_config_items() {
if [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" != "aarch64-darwin" ]]; then
Expand Down
Loading