From 895d66892000431313a716419db877677e4fe45c Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Mon, 17 Nov 2025 16:07:10 -0500 Subject: [PATCH 1/7] feat: add PG 17.7 --- README.md | 2 +- ansible/vars.yml | 2 +- migrations/schema-17.sql | 4 ++-- nix/config.nix | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 67b17df01..a115de2e9 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,7 @@ This is the same PostgreSQL build that powers [Supabase](https://supabase.io), b ## Primary Features - ✅ Postgres [postgresql-15.14](https://www.postgresql.org/docs/15/index.html) -- ✅ Postgres [postgresql-17.6](https://www.postgresql.org/docs/17/index.html) +- ✅ Postgres [postgresql-17.7](https://www.postgresql.org/docs/17/index.html) - ✅ Postgres [orioledb-postgresql-17_11](https://github.com/orioledb/orioledb) - ✅ Ubuntu 24.04 (Noble Numbat). - ✅ [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) = logical and [max_replication_slots](https://www.postgresql.org/docs/current/runtime-config-replication.html) = 5. Ready for replication. diff --git a/ansible/vars.yml b/ansible/vars.yml index eb248b55b..a7a492a17 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,7 +11,7 @@ postgres_major: # Full version strings for each major version postgres_release: postgresorioledb-17: "17.5.1.073-orioledb" - postgres17: "17.6.1.052" + postgres17: "17.7.1.001" postgres15: "15.14.1.052" # Non Postgres Extensions diff --git a/migrations/schema-17.sql b/migrations/schema-17.sql index e0b353e9d..440fd7b73 100644 --- a/migrations/schema-17.sql +++ b/migrations/schema-17.sql @@ -4,8 +4,8 @@ \restrict SupabaseTestDumpKey123 --- Dumped from database version 17.6 --- Dumped by pg_dump version 17.6 +-- Dumped from database version 17.7 +-- Dumped by pg_dump version 17.7 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/nix/config.nix b/nix/config.nix index 4076f0cea..1e5634bc7 100644 --- a/nix/config.nix +++ b/nix/config.nix @@ -46,8 +46,8 @@ in hash = "sha256-Bt110wXNOHDuYrOTLmYcYkVD6vmuK6N83sCk+O3QUdI="; }; "17" = { - version = "17.6"; - hash = "sha256-4GMKNgCuonURcVVjJZ7CERzV9DU6SwQOC+gn+UzXqLA="; + version = "17.7"; + hash = "sha256-7540MwLszTMRLxsvAke+STy1doMTretViwLeh5ei6bU"; }; }; orioledb = { From 25ac6c913b3f152b5aaf02b6c4a3c556b7d102ee Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Tue, 18 Nov 2025 11:00:49 -0500 Subject: [PATCH 2/7] feat: Add PostgreSQL conf.d directory Introduce a `conf.d` directory for PostgreSQL configuration to improve modularity and organization. Changes include: - Dockerfiles: Copy and chown `conf.d` to `/etc/postgresql-custom/`. - Ansible: Add `conf.d/.gitkeep` and update `postgresql.conf.j2` to include `conf.d`. - Nix: Define path for `conf.d` and add substitution for `POSTGRESQL_CONFIG_DIR`. - `run-server.sh.in`: Copy `conf.d` to the data directory and update `postgresql.conf` to include it. - `vars.yml`: Append `-INDATA253` to postgresql release versions. --- Dockerfile-15 | 5 +++-- Dockerfile-17 | 5 +++-- Dockerfile-orioledb-17 | 5 +++-- ansible/files/postgresql_config/conf.d/.gitkeep | 0 ansible/files/postgresql_config/postgresql.conf.j2 | 3 +-- ansible/vars.yml | 6 +++--- nix/packages/lib.nix | 10 ++++++++++ nix/tools/run-server.sh.in | 8 ++++++++ 8 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 ansible/files/postgresql_config/conf.d/.gitkeep diff --git a/Dockerfile-15 b/Dockerfile-15 index 357119c4c..d1d34bca5 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -173,6 +173,7 @@ COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts @@ -193,8 +194,8 @@ RUN sed -i \ 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 && \ - chown postgres:postgres /etc/postgresql-custom + mkdir -p /etc/postgresql-custom/conf.d && \ + chown -R postgres:postgres /etc/postgresql-custom # # Include schema migrations COPY migrations/db /docker-entrypoint-initdb.d/ diff --git a/Dockerfile-17 b/Dockerfile-17 index 9cf39713d..537a7fec3 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -178,6 +178,7 @@ COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts @@ -198,8 +199,8 @@ RUN sed -i \ 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 && \ - chown postgres:postgres /etc/postgresql-custom + mkdir -p /etc/postgresql-custom/conf.d && \ + chown -R postgres:postgres /etc/postgresql-custom # Remove items from postgresql.conf RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf" diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 53d64cae8..4c1cb8e54 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -178,6 +178,7 @@ COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts @@ -198,8 +199,8 @@ RUN sed -i \ 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 && \ - chown postgres:postgres /etc/postgresql-custom + mkdir -p /etc/postgresql-custom/conf.d && \ + chown -R postgres:postgres /etc/postgresql-custom # Remove items from postgresql.conf RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf" diff --git a/ansible/files/postgresql_config/conf.d/.gitkeep b/ansible/files/postgresql_config/conf.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/ansible/files/postgresql_config/postgresql.conf.j2 b/ansible/files/postgresql_config/postgresql.conf.j2 index 5d4237068..bc2eab604 100644 --- a/ansible/files/postgresql_config/postgresql.conf.j2 +++ b/ansible/files/postgresql_config/postgresql.conf.j2 @@ -750,8 +750,6 @@ jit_provider = 'llvmjit' # JIT library to use # default postgresql.conf. Note that these are directives, not variable # assignments, so they can usefully be given more than once. -#include_dir = '...' # include files ending in '.conf' from - # a directory, e.g., 'conf.d' #include_if_exists = '...' # include file only if it exists #include = '...' # include file @@ -769,6 +767,7 @@ include = '/etc/postgresql-custom/read-replica.conf' # supautils specific configurations #include = '/etc/postgresql-custom/supautils.conf' +include_dir = '/etc/postgresql-custom/conf.d' # include files ending in '.conf' from a directory, e.g., 'conf.d' #------------------------------------------------------------------------------ # CUSTOMIZED OPTIONS #------------------------------------------------------------------------------ diff --git a/ansible/vars.yml b/ansible/vars.yml index a7a492a17..208176123 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.5.1.073-orioledb" - postgres17: "17.7.1.001" - postgres15: "15.14.1.052" + postgresorioledb-17: "17.5.1.073-orioledb-INDATA253" + postgres17: "17.7.1.001-INDATA253" + postgres15: "15.14.1.052-INDATA253" # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/packages/lib.nix b/nix/packages/lib.nix index 0bd3d071e..505eded02 100644 --- a/nix/packages/lib.nix +++ b/nix/packages/lib.nix @@ -36,6 +36,10 @@ name = "postgresql.conf"; path = ../../ansible/files/postgresql_config/postgresql.conf.j2; }; + configConfDir = builtins.path { + name = "conf.d"; + path = ../../ansible/files/postgresql_config/conf.d; + }; supautilsConfigFile = builtins.path { name = "supautils.conf"; path = ../../ansible/files/postgresql_config/supautils.conf.j2; @@ -72,6 +76,11 @@ else "${pkgs.glibcLocales}/lib/locale/locale-archive"; + postgresqlConfigBaseDir = builtins.path { + name = "postgresql_config"; + path = ../../ansible/files/postgresql_config; + }; + substitutions = { SHELL_PATH = "${pkgs.bash}/bin/bash"; PGSQL_DEFAULT_PORT = "${defaults.port}"; @@ -79,6 +88,7 @@ PSQL15_BINDIR = "${psql_15}"; PSQL17_BINDIR = "${psql_17}"; PSQL_CONF_FILE = "${paths.pgconfigFile}"; + POSTGRESQL_CONFIG_DIR = "${postgresqlConfigBaseDir}"; PSQLORIOLEDB17_BINDIR = "${psql_orioledb-17}"; PGSODIUM_GETKEY = "${paths.getkeyScript}"; READREPL_CONF_FILE = "${paths.readReplicaConfigFile}"; diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 182cbe554..4506ad1e3 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -215,6 +215,13 @@ fi echo "NOTE: patching postgresql.conf files" cp "$PG_HBA_FILE" "$DATDIR/pg_hba.conf" cp "$PG_IDENT_FILE" "$DATDIR/pg_ident.conf" +# Copy entire conf.d directory from postgresql_config +POSTGRESQL_CONFIG_DIR="@POSTGRESQL_CONFIG_DIR@" +cp -r "$POSTGRESQL_CONFIG_DIR/conf.d" "$DATDIR/" + +# Make conf.d files writable (they're read-only from Nix store) +chmod -R u+w "$DATDIR/conf.d" + cp "$READREPL_CONFIG_FILE" "$DATDIR/read-replica.conf" mkdir -p "$DATDIR/extension-custom-scripts" cp -r "$EXTENSION_CUSTOM_SCRIPTS"/* "$DATDIR/extension-custom-scripts" @@ -236,6 +243,7 @@ vault.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ -e "s|include = '/etc/postgresql-custom/read-replica.conf'|include = '$DATDIR/read-replica.conf'|" \ -e "\$a\\ session_preload_libraries = 'supautils'" \ +-e "s|include_dir = '/etc/postgresql-custom/conf.d'|include_dir = '$DATDIR/conf.d'|" \ "$PSQL_CONF_FILE" > "$DATDIR/postgresql.conf" # Function to configure OrioleDB specific settings From 246c09d1d490f7b4552675fa60dd99b2cf3190ad Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Thu, 20 Nov 2025 16:42:52 -0500 Subject: [PATCH 3/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a115de2e9..67b17df01 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,7 @@ This is the same PostgreSQL build that powers [Supabase](https://supabase.io), b ## Primary Features - ✅ Postgres [postgresql-15.14](https://www.postgresql.org/docs/15/index.html) -- ✅ Postgres [postgresql-17.7](https://www.postgresql.org/docs/17/index.html) +- ✅ Postgres [postgresql-17.6](https://www.postgresql.org/docs/17/index.html) - ✅ Postgres [orioledb-postgresql-17_11](https://github.com/orioledb/orioledb) - ✅ Ubuntu 24.04 (Noble Numbat). - ✅ [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) = logical and [max_replication_slots](https://www.postgresql.org/docs/current/runtime-config-replication.html) = 5. Ready for replication. From 192bc872b5b1d2b0cc891004b707cbcde6e29f1f Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Thu, 20 Nov 2025 16:47:25 -0500 Subject: [PATCH 4/7] Update nix/config.nix --- nix/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/config.nix b/nix/config.nix index 7de199446..ae39afe9e 100644 --- a/nix/config.nix +++ b/nix/config.nix @@ -50,7 +50,7 @@ in hash = "sha256-Bt110wXNOHDuYrOTLmYcYkVD6vmuK6N83sCk+O3QUdI="; }; "17" = { - version = "17.7"; + version = "17.6"; hash = "sha256-7540MwLszTMRLxsvAke+STy1doMTretViwLeh5ei6bU"; }; }; From 905fdcc06987d15bcaddeec3cc46663399802764 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Thu, 20 Nov 2025 16:47:37 -0500 Subject: [PATCH 5/7] Update nix/config.nix --- nix/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/config.nix b/nix/config.nix index ae39afe9e..ca8a841f5 100644 --- a/nix/config.nix +++ b/nix/config.nix @@ -51,7 +51,7 @@ in }; "17" = { version = "17.6"; - hash = "sha256-7540MwLszTMRLxsvAke+STy1doMTretViwLeh5ei6bU"; + hash = "sha256-4GMKNgCuonURcVVjJZ7CERzV9DU6SwQOC+gn+UzXqLA="; }; }; orioledb = { From 1a255048d4b32f9e737eaf5e29d4e2c2d9b77cb6 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Thu, 20 Nov 2025 16:56:53 -0500 Subject: [PATCH 6/7] Update ansible/vars.yml --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index e9f1f8f46..6f1004356 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.010-orioledb-INDATA253" - postgres17: "17.6.1.053-INDATA253" - postgres15: "15.14.1.053-INDATA253" + postgresorioledb-17: "17.6.0.011-orioledb" + postgres17: "17.6.1.054" + postgres15: "15.14.1.054" # Non Postgres Extensions pgbouncer_release: 1.19.0 From 2d8d279a695f140618ee8d222430f4c43b9b567d Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 21 Nov 2025 11:57:48 -0500 Subject: [PATCH 7/7] tests: rollback this version to 17.6 --- migrations/schema-17.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/schema-17.sql b/migrations/schema-17.sql index 440fd7b73..e0b353e9d 100644 --- a/migrations/schema-17.sql +++ b/migrations/schema-17.sql @@ -4,8 +4,8 @@ \restrict SupabaseTestDumpKey123 --- Dumped from database version 17.7 --- Dumped by pg_dump version 17.7 +-- Dumped from database version 17.6 +-- Dumped by pg_dump version 17.6 SET statement_timeout = 0; SET lock_timeout = 0;