Skip to content

Commit 4bd0708

Browse files
committed
feat: add safeupdate to shared_preload_libraries
But disable it by default
1 parent 38756f8 commit 4bd0708

File tree

6 files changed

+18
-2
lines changed

6 files changed

+18
-2
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,7 @@ RUN sed -i \
941941
echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
942942
echo "pgsodium.getkey_script= '/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
943943
echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
944+
echo 'safeupdate.enabled = off' >> /etc/postgresql/postgresql.conf && \
944945
useradd --create-home --shell /bin/bash wal-g -G postgres && \
945946
mkdir -p /etc/postgresql-custom && \
946947
chown postgres:postgres /etc/postgresql-custom

ansible/files/postgresql_config/postgresql.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ default_text_search_config = 'pg_catalog.english'
688688
#local_preload_libraries = ''
689689
#session_preload_libraries = ''
690690

691-
shared_preload_libraries = 'pg_stat_statements, pg_stat_monitor, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter' # (change requires restart)
691+
shared_preload_libraries = 'pg_stat_statements, pg_stat_monitor, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, safeupdate' # (change requires restart)
692692
jit_provider = 'llvmjit' # JIT library to use
693693

694694
# - Other Defaults -

ansible/files/postgresql_config/supautils.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ supautils.privileged_extensions = 'address_standardizer, address_standardizer_da
77
supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'
88
supautils.privileged_extensions_superuser = 'supabase_admin'
99
supautils.privileged_role = 'postgres'
10-
supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_min_messages, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, session_replication_role, track_io_timing'
10+
supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_min_messages, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing'
1111
supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, authenticator'
1212
supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*'

ansible/tasks/postgres-extensions/09-pg-safeupdate.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,10 @@
2828
file:
2929
state: absent
3030
path: /tmp/pg-safeupdate-{{ pg_safeupdate_release }}
31+
32+
- name: pg-safeupdate - set safeupdate.enabled
33+
become: yes
34+
lineinfile:
35+
path: /etc/postgresql/postgresql.conf
36+
state: present
37+
line: safeupdate.enabled = off

ansible/tasks/setup-docker.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@
3838
state: present
3939
line: auto_explain.log_min_duration = 10s
4040

41+
- name: pg-safeupdate - set safeupdate.enabled
42+
become: yes
43+
lineinfile:
44+
path: /etc/postgresql/postgresql.conf
45+
state: present
46+
line: safeupdate.enabled = off
47+
4148
# supautils
4249
- name: supautils - add supautils to session_preload_libraries
4350
become: yes

docker/orioledb/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ RUN sed -i \
10371037
echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
10381038
echo "pgsodium.getkey_script= '/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
10391039
echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
1040+
echo 'safeupdate.enabled = off' >> /etc/postgresql/postgresql.conf && \
10401041
echo "orioledb.main_buffers = 1GB" >> /etc/postgresql/postgresql.conf && \
10411042
echo "orioledb.undo_buffers = 256MB" >> /etc/postgresql/postgresql.conf && \
10421043
useradd --create-home --shell /bin/bash wal-g -G postgres && \

0 commit comments

Comments
 (0)