supabase-postgres.git / summary / log / commit / refs

commit    a119df982dd382a930f678c32c51253a2516d36f
Author:   Douglas J Hunley <doug.hunley@gmail.com>
Commit:   GitHub <noreply@github.com>
Date:     Tue Nov 25 21:17:49 2025 +0000

    refactor: Move PostgreSQL auto_explain config to conf.d (#1943)
    
    * 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.
    
    * refactor: Simplify PostgreSQL conf template sourcing
    
    The source path for PostgreSQL configuration templates has been simplified.
    
    Previously, underscores in `ext_item` were removed when constructing the template filename. This change removes that transformation, directly using `{{ ext_item }}.conf`. This implies that template files in `files/postgresql_config/conf.d/` now match the `ext_item` loop variables directly (e.g., `auto_explain.conf`).


Dockerfile-15 | 1 - Dockerfile-17 | 1 - Dockerfile-orioledb-17 | 1 - ansible/files/postgresql_config/conf.d/auto_explain.conf | 1 + ansible/files/postgresql_config/postgresql.conf.j2 | 1 - ansible/tasks/finalize-ami.yml | 11 +++++++++++ ansible/vars.yml | 6 +++--- 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index 0de25b84..e79cb2e5 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -241,7 +241,6 @@ RUN sed -i \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /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 && \ - echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom/conf.d && \ chown -R postgres:postgres /etc/postgresql-custom diff --git a/Dockerfile-17 b/Dockerfile-17 index 94af0816..cad7b76b 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -246,7 +246,6 @@ RUN sed -i \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /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 && \ - echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom/conf.d && \ chown -R postgres:postgres /etc/postgresql-custom diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 27c321d0..19fae02b 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -246,7 +246,6 @@ RUN sed -i \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /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 && \ - echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom/conf.d && \ chown -R postgres:postgres /etc/postgresql-custom diff --git a/ansible/files/postgresql_config/conf.d/auto_explain.conf b/ansible/files/postgresql_config/conf.d/auto_explain.conf new file mode 100644 index 00000000..c95c01e2 --- /dev/null +++ b/ansible/files/postgresql_config/conf.d/auto_explain.conf @@ -0,0 +1 @@ +auto_explain.log_min_duration = 10s diff --git a/ansible/files/postgresql_config/postgresql.conf.j2 b/ansible/files/postgresql_config/postgresql.conf.j2 index bc2eab60..fc77c63b 100644 --- a/ansible/files/postgresql_config/postgresql.conf.j2 +++ b/ansible/files/postgresql_config/postgresql.conf.j2 @@ -773,5 +773,4 @@ include_dir = '/etc/postgresql-custom/conf.d' # include files ending in '.conf' #------------------------------------------------------------------------------ # Add settings for extensions here -auto_explain.log_min_duration = 10s cron.database_name = 'postgres' diff --git a/ansible/tasks/finalize-ami.yml b/ansible/tasks/finalize-ami.yml index 1cc729fc..5b9dee91 100644 --- a/ansible/tasks/finalize-ami.yml +++ b/ansible/tasks/finalize-ami.yml @@ -4,6 +4,17 @@ group: 'postgres' src: 'files/postgresql_config/postgresql-csvlog.conf' +- name: auto_explain and pg_cron confs + ansible.builtin.template: + dest: "/etc/postgresql-custom/conf.d/{{ ext_item }}.conf" + group: 'postgres' + src: "files/postgresql_config/conf.d/{{ ext_item }}.conf" + loop: + - auto_explain + # - pg_cron + loop_control: + loop_var: 'ext_item' + - name: UFW - Allow SSH connections community.general.ufw: name: 'OpenSSH' diff --git a/ansible/vars.yml b/ansible/vars.yml index a7e55c0a..5423e936 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.6.0.011-orioledb" - postgres17: "17.6.1.054" - postgres15: "15.14.1.054" + postgresorioledb-17: "17.6.0.011-orioledb-INDATA-255" + postgres17: "17.6.1.054-INDATA-255" + postgres15: "15.14.1.054-INDATA-255" # Non Postgres Extensions pgbouncer_release: 1.19.0 [parent: d1f4f72353b5]