Skip to content

Commit cf17734

Browse files
committed
postgres: 15.16 -> 15.19, 17.6 -> 17.11
PG 15.19/17.11 introduces output_plugin_libraries (CVE-2026-6471) defaulting to pgoutput and test_decoding only, which breaks wal2json slots (Realtime, CI wal2json tests). Allow wal2json in the shared config.
1 parent 2cca277 commit cf17734

13 files changed

Lines changed: 30 additions & 38 deletions

File tree

‎Dockerfile-multigres‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,10 @@ RUN chown -R postgres:postgres /usr/lib/postgresql && \
263263
RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' \
264264
/etc/postgresql-custom/supautils.conf
265265

266-
# Add orioledb to shared_preload_libraries and configure as default table access method
267-
# orioledb-17 is pinned to 17.11+, which added output_plugin_libraries
268-
# as an allow-list for logical decoding output plugins.
269-
RUN sed -i "s/\(shared_preload_libraries.*\)'/\1, orioledb'/" /etc/postgresql/postgresql.conf && \
270-
echo "default_table_access_method = 'orioledb'" >> /etc/postgresql/postgresql.conf && \
271-
echo "output_plugin_libraries = 'pgoutput, test_decoding, wal2json'" >> /etc/postgresql/postgresql.conf
266+
# OrioleDB configuration
267+
RUN sed -i /etc/postgresql/postgresql.conf \
268+
-e "/shared_preload_libraries/ s|'|'orioledb,|" \
269+
-e "$ a default_table_access_method = 'orioledb'" \
272270

273271
# Register orioledb before initdb migrations run
274272
RUN echo "CREATE EXTENSION orioledb;" > /docker-entrypoint-initdb.d/init-scripts/00-pre-init.sql && \

‎Dockerfile-orioledb-17‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,10 @@ RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf" && \
155155
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/supautils.conf"
156156

157157
# OrioleDB configuration
158-
RUN sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "/etc/postgresql/postgresql.conf" && \
159-
echo "default_table_access_method = 'orioledb'" >> "/etc/postgresql/postgresql.conf"
160-
161-
# orioledb-17 is pinned to 17.11+, which added output_plugin_libraries as an
162-
# allow-list for logical decoding output plugins
163-
RUN echo "output_plugin_libraries = 'pgoutput, test_decoding, wal2json'" >> "/etc/postgresql/postgresql.conf"
158+
RUN sed -i /etc/postgresql/postgresql.conf \
159+
-e "/shared_preload_libraries/ s|'|'orioledb,|" \
160+
-e "$ a default_table_access_method = 'orioledb'" \
161+
-e "$ a output_plugin_libraries = 'pgoutput, test_decoding, wal2json'"
164162

165163
# Include schema migrations
166164
COPY migrations/db /docker-entrypoint-initdb.d/

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ This is the same PostgreSQL build that powers [Supabase](https://supabase.io), b
181181

182182

183183
## Primary Features
184-
- ✅ Postgres [postgresql-15.14](https://www.postgresql.org/docs/15/index.html)
185-
- ✅ Postgres [postgresql-17.6](https://www.postgresql.org/docs/17/index.html)
184+
- ✅ Postgres [postgresql-15.19](https://www.postgresql.org/docs/15/index.html)
185+
- ✅ Postgres [postgresql-17.11](https://www.postgresql.org/docs/17/index.html)
186186
- ✅ Postgres [orioledb-postgresql-17_11](https://github.com/orioledb/orioledb)
187187
- ✅ Ubuntu 24.04 (Noble Numbat).
188188
- ✅ [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.

‎ansible/files/postgresql_config/postgresql.conf.j2‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ shared_buffers = 128MB # min 128kB
204204

205205
wal_level = logical # minimal, replica, or logical
206206
# (change requires restart)
207+
output_plugin_libraries = 'pgoutput, test_decoding, wal2json' # allowlist of logical decoding
208+
# output plugins (PG 15.19 / 17.11+); wal2json is
209+
# required by Realtime and shipped in the image
207210
#fsync = on # flush data to disk for crash safety
208211
# (turning this off can cause
209212
# unrecoverable data corruption)

‎ansible/tasks/stage2-setup-postgres.yml‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,6 @@
4848
path: '/etc/postgresql/postgresql.conf'
4949
state: 'present'
5050

51-
# orioledb-17 is pinned to 17.11+, which added output_plugin_libraries
52-
# as an allow-list for logical decoding output plugins.
53-
- name: Allow wal2json as a logical decoding output plugin
54-
ansible.builtin.lineinfile:
55-
line: "output_plugin_libraries = 'pgoutput, test_decoding, wal2json'"
56-
path: '/etc/postgresql/postgresql.conf'
57-
state: 'present'
58-
5951
- name: Add ORIOLEDB_ENABLED environment variable
6052
ansible.builtin.lineinfile:
6153
line: 'ORIOLEDB_ENABLED=true'

‎docker/pgctld/postgresql.conf.tmpl‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ max_parallel_maintenance_workers = {{.MaxParallelMaintenanceWorkers}} # taken fr
8383

8484
wal_level = logical # minimal, replica, or logical
8585
# (change requires restart)
86+
output_plugin_libraries = 'pgoutput, test_decoding, wal2json' # allowlist of logical decoding
87+
# output plugins (PG 15.19 / 17.11+)
8688
wal_buffers = {{.WalBuffers}} # min 32kB, -1 sets based on shared_buffers
8789
# (change requires restart)
8890
min_wal_size = {{.MinWalSize}}

‎migrations/schema-15.sql‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
\restrict SupabaseTestDumpKey123
66

7-
-- Dumped from database version 15.14
8-
-- Dumped by pg_dump version 15.14
7+
-- Dumped from database version 15.19
8+
-- Dumped by pg_dump version 15.19
99

1010
SET statement_timeout = 0;
1111
SET lock_timeout = 0;

‎migrations/schema-17.sql‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
\restrict SupabaseTestDumpKey123
66

7-
-- Dumped from database version 17.6
8-
-- Dumped by pg_dump version 17.6
7+
-- Dumped from database version 17.11
8+
-- Dumped by pg_dump version 17.11
99

1010
SET statement_timeout = 0;
1111
SET lock_timeout = 0;

‎nix/checks.nix‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@
379379
echo "port = ${pgPort}"
380380
381381
echo "dynamic_library_path = '${supautils}/lib:\$libdir'"
382+
echo "output_plugin_libraries = 'pgoutput, test_decoding, wal2json'"
382383
echo "session_preload_libraries = 'supautils'"
383384
} >> "$PGTAP_CLUSTER"/postgresql.conf
384385
@@ -389,9 +390,6 @@
389390
# Add orioledb to shared_preload_libraries
390391
perl -pi -e "s/(shared_preload_libraries = ')/\$1orioledb, /" "$PGTAP_CLUSTER/postgresql.conf"
391392
log info "OrioleDB added to shared_preload_libraries"
392-
# orioledb-17 is pinned to 17.11+, which added output_plugin_libraries
393-
# as an allow-list for logical decoding output plugins.
394-
echo "output_plugin_libraries = 'pgoutput, test_decoding, wal2json'" >> "$PGTAP_CLUSTER/postgresql.conf"
395393
fi
396394
397395
log info "Checking shared_preload_libraries setting:"
@@ -538,7 +536,7 @@
538536
--host=localhost \
539537
--port=${pgPort} \
540538
--user=supabase_admin \
541-
${builtins.concatStringsSep " " (lib.lists.remove "hstore_copy_binary" sortedTestList)} 2>&1; then
539+
${builtins.concatStringsSep " " sortedTestList} 2>&1; then
542540
log error "pg_regress tests failed"
543541
cat "$out/regression_output/regression.diffs"
544542
exit 1

‎nix/config.nix‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ in
4646
supportedPostgresVersions = {
4747
postgres = {
4848
"15" = {
49-
version = "15.14";
50-
hash = "sha256-Bt110wXNOHDuYrOTLmYcYkVD6vmuK6N83sCk+O3QUdI=";
49+
version = "15.19";
50+
hash = "sha256-4aZKh6RrgluIwILkUYFhpHqrU8RWlJZPi6HfKPeFn4k=";
5151
};
5252
"17" = {
53-
version = "17.6";
54-
hash = "sha256-4GMKNgCuonURcVVjJZ7CERzV9DU6SwQOC+gn+UzXqLA=";
53+
version = "17.11";
54+
hash = "sha256-3Sfys8Wec+0UqjMkkBJCv2mgMqY0eAXydOYmAyLUKXk=";
5555
};
5656
};
5757
orioledb = {

0 commit comments

Comments
 (0)