anchor.diff:  #track_io_timing = off
   #track_functions = none			# none, pl, all
   #track_activity_query_size = 1024	# (change requires restart)
  -stats_temp_directory = '/var/run/postgresql/13-main.pg_stat_tmp'
  +stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
   
   
   # - Monitoring -
  
positive.code: 					#   %q = stop here in non-session
  					#        processes
  					#   %% = '%'
  					# e.g. '<%u%%%d> '
  #log_lock_waits = off			# log lock waits >= deadlock_timeout
  #log_parameter_max_length = -1		# when logging statements, limit logged
  					# bind-parameter values to N bytes;
  
negative.code: #------------------------------------------------------------------------------
  
  # Add settings for extensions here
  timezone = 'UTC'
  default_text_search_config = 'zulip.english_us_search'
  
  log_destination = 'stderr'
  logging_collector = on
  log_directory = '/var/log/postgresql'
  log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
  log_rotation_age = 7d
  log_rotation_size = 100MB
  log_min_duration_statement = 500
  log_line_prefix = '%m [%c]: [%l-1] '
  log_checkpoints = on
  log_lock_waits = on
  log_temp_files = 0
  log_autovacuum_min_duration = 100
  
  autovacuum_freeze_max_age = 2000000000
  vacuum_freeze_min_age     = 1000000000
  vacuum_freeze_table_age   = 1800000000
  
  # Performance settings
  max_connections = 1000
  maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
  effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
  work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
  shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
  wal_buffers = 4MB
  checkpoint_completion_target = 0.7
  <% if @random_page_cost != '' -%>
  random_page_cost = <%= @random_page_cost %>
  <% end -%>
  <% if @effective_io_concurrency != '' -%>
  effective_io_concurrency = <%= @effective_io_concurrency %>
  <% end -%>
  
  <% if @listen_addresses != '' -%>
  listen_addresses = <%= @listen_addresses %>
  <% end -%>
  
  <% if @replication != '' -%>
  # Primary replication settings (ignored on replica)
  wal_level = hot_standby
  max_wal_senders = 5
  archive_mode = on
  archive_command = '/usr/bin/timeout 10m /usr/local/bin/env-wal-g wal-push %p'
  
  # Replica settings (ignored on primary)
  hot_standby = on
  <% end -%>
  
  <% if @ssl_cert_file != '' -%>
  ssl_cert_file = '<%= @ssl_cert_file %>'		# (change requires restart)
  <% end -%>
  <% if @ssl_key_file != '' -%>
  ssl_key_file = '<%= @ssl_key_file %>'		# (change requires restart)
  <% end -%>
  <% if @ssl_ca_file != '' -%>
  ssl_ca_file = '<%= @ssl_ca_file %>'		# (change requires restart)
  <% end -%>
  