setup-postgres.sh 883 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. # Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Use of this software is governed by the Business Source License
  5. # included in the LICENSE file at the root of this repository.
  6. #
  7. # As of the Change Date specified in that file, in accordance with
  8. # the Business Source License, use of this software will be governed
  9. # by the Apache License, Version 2.0.
  10. set -e
  11. cat >> "$PGDATA/postgresql.conf" <<-EOCONF
  12. ssl = on
  13. ssl_cert_file = '/share/secrets/postgres.crt'
  14. ssl_key_file = '/share/secrets/postgres.key'
  15. ssl_ca_file = '/share/secrets/ca.crt'
  16. hba_file = '/share/conf/pg_hba.conf'
  17. wal_level = logical
  18. fsync = off
  19. max_wal_senders = 20
  20. max_replication_slots = 20
  21. shared_preload_libraries = 'pg_cron'
  22. max_worker_processes = 16
  23. cron.database_name = 'postgres'
  24. cron.use_background_workers = on
  25. cron.log_statement = off
  26. cron.log_run = off
  27. EOCONF