]> git.openstreetmap.org Git - chef.git/blob - cookbooks/postgresql/templates/default/postgresql.conf.erb
podman: revert to using default slirp4netns mtu
[chef.git] / cookbooks / postgresql / templates / default / postgresql.conf.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 #------------------------------------------------------------------------------
4 # FILE LOCATIONS
5 #------------------------------------------------------------------------------
6
7 data_directory = '/var/lib/postgresql/<%= @version %>/main'
8 hba_file = '/etc/postgresql/<%= @version %>/main/pg_hba.conf'
9 ident_file = '/etc/postgresql/<%= @version %>/main/pg_ident.conf'
10 external_pid_file = '/var/run/postgresql/<%= @version %>-main.pid'
11
12 #------------------------------------------------------------------------------
13 # CONNECTIONS AND AUTHENTICATION
14 #------------------------------------------------------------------------------
15
16 # - Connection Settings -
17
18 <% if @settings[:listen_addresses] || @defaults[:listen_addresses] -%>
19 listen_addresses = '<%= @settings[:listen_addresses] || @defaults[:listen_addresses] %>'
20 <% end -%>
21 port = <%= @settings[:port] || @defaults[:port] %>
22 max_connections = <%= @settings[:max_connections] || @defaults[:max_connections] %>
23 unix_socket_directories = '/var/run/postgresql'
24
25 # - Security and Authentication -
26
27 ssl = <%= @settings[:ssl] || @defaults[:ssl] %>
28 ssl_renegotiation_limit = 0
29
30 #------------------------------------------------------------------------------
31 # RESOURCE USAGE (except WAL)
32 #------------------------------------------------------------------------------
33
34 # - Memory -
35
36 shared_buffers = <%= @settings[:shared_buffers] || @defaults[:shared_buffers] %>
37 temp_buffers = <%= @settings[:temp_buffers] || @defaults[:temp_buffers] %>
38 work_mem = <%= @settings[:work_mem] || @defaults[:work_mem] %>
39 maintenance_work_mem = <%= @settings[:maintenance_work_mem] || @defaults[:maintenance_work_mem] %>
40 max_stack_depth = <%= @settings[:max_stack_depth] || @defaults[:max_stack_depth] %>
41
42 # - Asynchronous Behavior -
43
44 effective_io_concurrency = <%= @settings[:effective_io_concurrency] || @defaults[:effective_io_concurrency] %>
45 max_worker_processes = <%= @settings[:max_worker_processes] || @defaults[:max_worker_processes] %>
46 max_parallel_workers_per_gather = <%= @settings[:max_parallel_workers_per_gather] || @defaults[:max_parallel_workers_per_gather] %>
47 max_parallel_workers = <%= @settings[:max_parallel_workers] || @defaults[:max_parallel_workers] %>
48
49 #------------------------------------------------------------------------------
50 # WRITE AHEAD LOG
51 #------------------------------------------------------------------------------
52
53 # - Settings -
54
55 wal_level = <%= @settings[:wal_level] || @defaults[:wal_level] %>
56 fsync = <%= @settings[:fsync] || @defaults[:fsync] %>
57 synchronous_commit = <%= @settings[:synchronous_commit] || @defaults[:synchronous_commit] %>
58 wal_buffers = <%= @settings[:wal_buffers] || @defaults[:wal_buffers] %>
59 wal_writer_delay = <%= @settings[:wal_writer_delay] || @defaults[:wal_writer_delay] %>
60 commit_delay = <%= @settings[:commit_delay] || @defaults[:commit_delay] %>
61
62 # - Checkpoints -
63
64 checkpoint_timeout = <%= @settings[:checkpoint_timeout] || @defaults[:checkpoint_timeout] %>
65 checkpoint_completion_target = <%= @settings[:checkpoint_completion_target] || @defaults[:checkpoint_completion_target] %>
66 max_wal_size = <%= @settings[:max_wal_size] || @defaults[:max_wal_size] %>
67 min_wal_size = <%= @settings[:min_wal_size] || @defaults[:min_wal_size] %>
68
69 # - Archiving -
70
71 archive_mode = <%= @settings[:archive_mode] || @defaults[:archive_mode] %>
72 <% if @settings[:archive_command] || @defaults[:archive_command] -%>
73 archive_command = '<%= @settings[:archive_command] || @defaults[:archive_command] %>'
74 <% end -%>
75
76 # - Archive Recovery -
77
78 # These are only used in recovery mode.
79
80 <% if @settings[:restore_command] || @defaults[:restore_command] -%>
81 restore_command = '<%= @settings[:restore_command] || @defaults[:restore_command] %>'
82 <% end -%>
83
84 #------------------------------------------------------------------------------
85 # REPLICATION
86 #------------------------------------------------------------------------------
87
88 # - Sending Server(s) -
89
90 max_wal_senders = <%= @settings[:max_wal_senders] || @defaults[:max_wal_senders] %>
91 max_replication_slots = <%= @settings[:max_replication_slots] || @defaults[:max_replication_slots] %>
92 wal_keep_size = <%= @settings[:wal_keep_size] || @defaults[:wal_keep_size] %>
93
94 # - Standby Servers -
95
96 <% if @primary_conninfo -%>
97 primary_conninfo = 'host=<%= @primary_conninfo[:host] %> port=<%= @primary_conninfo[:port] %> user=<%= @primary_conninfo[:user] %> password=<%= @passwords[@primary_conninfo[:user]] %>'
98 <% end -%>
99 hot_standby = <%= @settings[:hot_standby] || @defaults[:hot_standby] %>
100 hot_standby_feedback = <%= @settings[:hot_standby_feedback] || @defaults[:hot_standby_feedback] %>
101
102 #------------------------------------------------------------------------------
103 # QUERY TUNING
104 #------------------------------------------------------------------------------
105
106 # - Planner Cost Constants -
107
108 seq_page_cost = <%= @settings[:seq_page_cost] || @defaults[:seq_page_cost] %>
109 random_page_cost = <%= @settings[:random_page_cost] || @defaults[:random_page_cost] %>
110 cpu_tuple_cost = <%= @settings[:cpu_tuple_cost] || @defaults[:cpu_tuple_cost] %>
111 effective_cache_size = <%= @settings[:effective_cache_size] || @defaults[:effective_cache_size] %>
112
113 # - Other Planner Options -
114
115 default_statistics_target = <%= @settings[:default_statistics_target] || @defaults[:default_statistics_target] %>
116 jit = <%= @settings[:jit] || @defaults[:jit] %>
117
118 #------------------------------------------------------------------------------
119 # REPORTING AND LOGGING
120 #------------------------------------------------------------------------------
121
122 # - When to Log -
123
124 log_min_duration_statement = <%= @settings[:log_min_duration_statement] || @defaults[:log_min_duration_statement] %>
125
126 # - What to Log -
127
128 log_autovacuum_min_duration = <%= @settings[:log_autovacuum_min_duration] || @defaults[:log_autovacuum_min_duration] %>
129 log_line_prefix = '%t '
130
131 #------------------------------------------------------------------------------
132 # RUNTIME STATISTICS
133 #------------------------------------------------------------------------------
134
135 # - Query/Index Statistics Collector -
136
137 track_activity_query_size = <%= @settings[:track_activity_query_size] || @defaults[:track_activity_query_size] %>
138 <% if @version.to_f < 15 -%>
139 stats_temp_directory = '/run/postgresql/<%= @version %>-main.pg_stat_tmp'
140 <% end -%>
141
142 #------------------------------------------------------------------------------
143 # AUTOVACUUM PARAMETERS
144 #------------------------------------------------------------------------------
145
146 autovacuum_max_workers = <%= @settings[:autovacuum_max_workers] || @defaults[:autovacuum_max_workers] %>
147 autovacuum_naptime = <%= @settings[:autovacuum_naptime] || @defaults[:autovacuum_naptime] %>
148 autovacuum_vacuum_scale_factor = <%= @settings[:autovacuum_vacuum_scale_factor] || @defaults[:autovacuum_vacuum_scale_factor] %>
149 autovacuum_analyze_scale_factor = <%= @settings[:autovacuum_analyze_scale_factor] || @defaults[:autovacuum_analyze_scale_factor] %>
150 autovacuum_freeze_max_age = <%= @settings[:autovacuum_freeze_max_age] || @defaults[:autovacuum_freeze_max_age] %>
151 autovacuum_multixact_freeze_max_age = <%= @settings[:autovacuum_multixact_freeze_max_age] || @defaults[:autovacuum_multixact_freeze_max_age] %>
152
153 #------------------------------------------------------------------------------
154 # CLIENT CONNECTION DEFAULTS
155 #------------------------------------------------------------------------------
156
157 # - Locale and Formatting -
158
159 datestyle = 'iso, dmy'
160 lc_messages = 'en_GB.UTF-8'
161 lc_monetary = 'en_GB.UTF-8'
162 lc_numeric = 'en_GB.UTF-8'
163 lc_time = 'en_GB.UTF-8'
164 default_text_search_config = 'pg_catalog.english'
165
166 # - Shared Library Preloading -
167
168 shared_preload_libraries = '<%= (@settings[:shared_preload_libraries] || @defaults[:shared_preload_libraries]).sort.join(",") %>'
169
170 #------------------------------------------------------------------------------
171 # LOCK MANAGEMENT
172 #------------------------------------------------------------------------------
173
174 max_locks_per_transaction = <%= @settings[:max_locks_per_transaction] || @defaults[:max_locks_per_transaction] %>
175
176 #------------------------------------------------------------------------------
177 # CUSTOMIZED OPTIONS
178 #------------------------------------------------------------------------------
179
180 <% Hash(@settings[:customized_options]).sort.each do |name, value| -%>
181 <%= name %> = <%= value %>
182 <% end -%>