Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix(self-host): don't override postgres shared_preload_libraries

Sidwebworks01b7f3ff197a
diff --git a/contrib/deploying/simple-docker-caddy/docker-compose.prod.yml b/contrib/deploying/simple-docker-caddy/docker-compose.prod.yml
index 4987d59475..253bcf4d16 100644
--- a/contrib/deploying/simple-docker-caddy/docker-compose.prod.yml
+++ b/contrib/deploying/simple-docker-caddy/docker-compose.prod.yml
@@ -172,15 +172,16 @@ services:
postgres:
image: supabase/postgres:15.14.1.112
entrypoint: ["/usr/local/bin/carbon-secrets-entrypoint.sh"]
- # Original entrypoint+cmd, plus production tuning. shared_preload_libraries
- # must be a server flag (it cannot be set via ALTER SYSTEM at runtime).
+ # Image's own entrypoint+cmd. Do NOT override shared_preload_libraries here:
+ # the image's postgresql.conf already preloads the full set Carbon needs
+ # (pg_stat_statements, pg_net, pg_cron, pgsodium, supabase_vault, …). Passing
+ # -c shared_preload_libraries=… would REPLACE that list and break extensions
+ # (e.g. the webhooks migration's `CREATE EXTENSION pg_net`).
command:
- docker-entrypoint.sh
- postgres
- -c
- config_file=/etc/postgresql/postgresql.conf
- - -c
- - shared_preload_libraries=pg_stat_statements
networks:
internal:
aliases: [db]
diff --git a/contrib/deploying/simple-docker-caddy/postgres/02-performance.sh b/contrib/deploying/simple-docker-caddy/postgres/02-performance.sh
index a0931db0c8..ec93408707 100755
--- a/contrib/deploying/simple-docker-caddy/postgres/02-performance.sh
+++ b/contrib/deploying/simple-docker-caddy/postgres/02-performance.sh
@@ -12,8 +12,8 @@
# - shared_buffers ~= 25% of RAM
# - effective_cache_size ~= 50-75% of RAM (a planner hint, not an allocation)
# - work_mem * max_connections should stay under ~25% of RAM
-# - pg_stat_statements: top-N slow/frequent query visibility (preloaded via the
-# shared_preload_libraries server flag in docker-compose.prod.yml's postgres command).
+# - pg_stat_statements: top-N slow/frequent query visibility (preloaded by the
+# image's default shared_preload_libraries, alongside pg_net, pg_cron, etc.).
set -euo pipefail
MAX_CONNECTIONS="${CARBON_PG_MAX_CONNECTIONS:-100}"
@@ -33,8 +33,8 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E
ALTER SYSTEM SET random_page_cost = '1.1';
ALTER SYSTEM SET effective_io_concurrency = '200';
- -- Query visibility. pg_stat_statements is preloaded via the postgres command
- -- flag (shared_preload_libraries) in docker-compose.prod.yml.
+ -- Query visibility. pg_stat_statements is preloaded by the image's default
+ -- shared_preload_libraries (see the postgres service in docker-compose.prod.yml).
ALTER SYSTEM SET track_io_timing = 'on';
ALTER SYSTEM SET pg_stat_statements.track = 'all';
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;