add note about multiple error messages
[discourse_docker.git] / templates / postgres.template.yml
index d97c936cf7d2bd11c765f3c9ab8936edcbf0ebce..76fb51dee78d24d01d35c9f46407d5a1e0b32d49 100644 (file)
@@ -5,6 +5,12 @@ params:
   db_default_text_search_config: "pg_catalog.english"
   db_name: discourse
   db_user: discourse
+  db_wal_level: minimal
+  db_max_wal_senders: 0
+  db_checkpoint_segments: 6
+  db_logging_collector: off
+  db_log_min_duration_statement: 100
+
 
 hooks:
   before_code:
@@ -149,12 +155,27 @@ run:
   - replace:
       filename: "/etc/postgresql/9.3/main/postgresql.conf"
       from: /#?max_wal_senders *=.*/
-      to: "max_wal_senders = 4"
+      to: "max_wal_senders = $db_max_wal_senders"
 
   - replace:
       filename: "/etc/postgresql/9.3/main/postgresql.conf"
       from: /#?wal_level *=.*/
-      to: "wal_level = hot_standby"
+      to: "wal_level = $db_wal_level"
+
+  - replace:
+      filename: "/etc/postgresql/9.3/main/postgresql.conf"
+      from: /#?checkpoint_segments *=.*/
+      to: "checkpoint_segments = $db_checkpoint_segments"
+
+  - replace:
+      filename: "/etc/postgresql/9.3/main/postgresql.conf"
+      from: /#?logging_collector *=.*/
+      to: "logging_collector = $db_logging_collector"
+
+  - replace:
+      filename: "/etc/postgresql/9.3/main/postgresql.conf"
+      from: /#?log_min_duration_statement *=.*/
+      to: "log_min_duration_statement = $db_log_min_duration_statement"
 
   - replace:
       filename: "/etc/postgresql/9.3/main/pg_hba.conf"
@@ -186,7 +207,7 @@ run:
   - exec: su postgres -c 'psql $db_name -c "create extension if not exists pg_trgm;"'
   - exec:
       stdin: |
-        update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = '$db_name' AND encoding = pg_encoding_to_char('SQL_ASCII');
+        update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = '$db_name' AND encoding = pg_char_to_encoding('SQL_ASCII');
       cmd: sudo -u postgres psql $db_name
       raise_on_fail: false