Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
5 changes: 3 additions & 2 deletions Dockerfile-15
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile-17
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile-orioledb-17
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Empty file.
3 changes: 1 addition & 2 deletions ansible/files/postgresql_config/postgresql.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
#------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions ansible/tasks/setup-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
- '/home/postgres'
- '/var/lib/postgresql/data'
- '/var/log/postgresql'
- '/etc/postgresql-custom/conf.d'
loop_control:
loop_var: 'pg_dir_item'

Expand All @@ -137,6 +138,7 @@
loop:
- '/etc/postgresql'
- '/etc/postgresql-custom'
- '/etc/postgresql-custom/conf.d'
loop_control:
loop_var: 'pg_config_dir_item'

Expand Down
6 changes: 3 additions & 3 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.6.0.010-orioledb"
postgres17: "17.6.1.053"
postgres15: "15.14.1.053"
postgresorioledb-17: "17.6.0.010-orioledb-INDATA253"
postgres17: "17.6.1.053-INDATA253"
postgres15: "15.14.1.053-INDATA253"

# Non Postgres Extensions
pgbouncer_release: 1.19.0
Expand Down
4 changes: 2 additions & 2 deletions migrations/schema-17.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions nix/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ in
hash = "sha256-Bt110wXNOHDuYrOTLmYcYkVD6vmuK6N83sCk+O3QUdI=";
};
"17" = {
version = "17.6";
hash = "sha256-4GMKNgCuonURcVVjJZ7CERzV9DU6SwQOC+gn+UzXqLA=";
version = "17.7";
hash = "sha256-7540MwLszTMRLxsvAke+STy1doMTretViwLeh5ei6bU";
};
};
orioledb = {
Expand Down
10 changes: 10 additions & 0 deletions nix/packages/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,13 +76,19 @@
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}";
PGSQL_SUPERUSER = "${defaults.superuser}";
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}";
Expand Down
8 changes: 8 additions & 0 deletions nix/tools/run-server.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
Loading