Skip to content

Commit 94651c4

Browse files
committed
fix: prevent DocumentDB RUM extension crash on startup
- Set documentdb_core.rum_library_load_option = 'try_documentdb_extended_rum' (was defaulting to 'require' which causes FATAL when .so has missing deps) - Wrap documentdb extensions in DO blocks so init script failures don't abort PG startup — PG stays healthy even if DocumentDB fails to load
1 parent ea89663 commit 94651c4

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

conf/postgresql.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,7 @@ cron.database_name = 'postgres'
5555
# pgvector specific - HNSW index build parallelism
5656
max_parallel_maintenance_workers = 4
5757

58-
# pg_documentdb - RUM library load option (default for PG18: require_documentdb_extended_rum)
59-
# documentdb.rum_library_load_option = 'require_documentdb_extended_rum'
58+
# pg_documentdb - RUM library load option
59+
# Default is 'require_documentdb_extended_rum' which crashes if the .so has missing deps.
60+
# Use 'try' so PG starts even if the RUM extension fails to load.
61+
documentdb_core.rum_library_load_option = 'try_documentdb_extended_rum'
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
-- Hanzo SQL: Enable extensions
2+
-- Using DO blocks so individual extension failures don't abort the init script.
23
CREATE EXTENSION IF NOT EXISTS vector;
34
CREATE EXTENSION IF NOT EXISTS pg_cron;
45
CREATE EXTENSION IF NOT EXISTS postgis;
56
CREATE EXTENSION IF NOT EXISTS tsm_system_rows;
6-
CREATE EXTENSION IF NOT EXISTS documentdb_core;
7-
CREATE EXTENSION IF NOT EXISTS documentdb;
7+
8+
-- DocumentDB extensions may fail if shared_preload_libraries config differs;
9+
-- wrap in DO block to keep PG running regardless.
10+
DO $$ BEGIN
11+
CREATE EXTENSION IF NOT EXISTS documentdb_core;
12+
EXCEPTION WHEN OTHERS THEN
13+
RAISE WARNING 'documentdb_core extension not loaded: %', SQLERRM;
14+
END $$;
15+
16+
DO $$ BEGIN
17+
CREATE EXTENSION IF NOT EXISTS documentdb;
18+
EXCEPTION WHEN OTHERS THEN
19+
RAISE WARNING 'documentdb extension not loaded: %', SQLERRM;
20+
END $$;

0 commit comments

Comments
 (0)