Skip to content

Commit a9c19fd

Browse files
committed
refactor: Move PostgreSQL auto_explain config to conf.d
Moves `auto_explain.log_min_duration` setting from inline Dockerfile definitions and the main PostgreSQL configuration file to a dedicated `auto_explain.conf` file within the `conf.d` directory. This change centralizes the configuration for better management and consistency across different PostgreSQL versions. Updates PostgreSQL release versions in `ansible/vars.yml` with the project-specific suffix.
1 parent d95ee44 commit a9c19fd

File tree

7 files changed

+15
-7
lines changed

7 files changed

+15
-7
lines changed

Dockerfile-15

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ RUN sed -i \
192192
#echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
193193
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
194194
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
195-
echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
196195
usermod -aG postgres wal-g && \
197196
mkdir -p /etc/postgresql-custom/conf.d && \
198197
chown -R postgres:postgres /etc/postgresql-custom

Dockerfile-17

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ RUN sed -i \
197197
#echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
198198
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
199199
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
200-
echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
201200
usermod -aG postgres wal-g && \
202201
mkdir -p /etc/postgresql-custom/conf.d && \
203202
chown -R postgres:postgres /etc/postgresql-custom

Dockerfile-orioledb-17

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ RUN sed -i \
197197
#echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
198198
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
199199
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
200-
echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
201200
usermod -aG postgres wal-g && \
202201
mkdir -p /etc/postgresql-custom/conf.d && \
203202
chown -R postgres:postgres /etc/postgresql-custom
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto_explain.log_min_duration = 10s

ansible/files/postgresql_config/postgresql.conf.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,5 +773,4 @@ include_dir = '/etc/postgresql-custom/conf.d' # include files ending in '.conf'
773773
#------------------------------------------------------------------------------
774774

775775
# Add settings for extensions here
776-
auto_explain.log_min_duration = 10s
777776
cron.database_name = 'postgres'

ansible/tasks/finalize-ami.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
group: 'postgres'
55
src: 'files/postgresql_config/postgresql-csvlog.conf'
66

7+
- name: auto_explain and pg_cron confs
8+
ansible.builtin.template:
9+
dest: "/etc/postgresql-custom/conf.d/{{ ext_item }}.conf"
10+
group: 'postgres'
11+
src: "files/postgresql_config/conf.d/{{ ext_item | split('_') | join('') }}.conf"
12+
loop:
13+
- auto_explain
14+
# - pg_cron
15+
loop_control:
16+
loop_var: 'ext_item'
17+
718
- name: UFW - Allow SSH connections
819
community.general.ufw:
920
name: 'OpenSSH'

ansible/vars.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ postgres_major:
1010

1111
# Full version strings for each major version
1212
postgres_release:
13-
postgresorioledb-17: "17.6.0.011-orioledb"
14-
postgres17: "17.6.1.054"
15-
postgres15: "15.14.1.054"
13+
postgresorioledb-17: "17.6.0.011-orioledb-INDATA-255"
14+
postgres17: "17.6.1.054-INDATA-255"
15+
postgres15: "15.14.1.054-INDATA-255"
1616

1717
# Non Postgres Extensions
1818
pgbouncer_release: 1.19.0

0 commit comments

Comments
 (0)