# Tuning
shared_buffers = {{ postgresql_shared_buffers }}
work_mem = {{ postgresql_work_mem }}
listen_addresses = '{{ postgresql_listen_addresses | join(',') }}'
#shared_preload_libraries = 'pg_stat_statements'
#synchronous_commit = off
{% if postgresql_version is version('9.5', '<') %}
checkpoint_segments = 30
{% else %}
max_wal_size = 15GB
{% endif %}
{% if postgresql_max_connections and postgresql_max_connections | int > 0 %}
max_connections = {{ postgresql_max_connections }}
{% endif %}

checkpoint_completion_target = 0.9
random_page_cost = {{ postgresql_random_page_cost }}
effective_cache_size = {{ postgresql_effective_cache_size }}

# Logging
log_min_duration_statement = 1s
log_checkpoints = on
log_lock_waits = on
log_temp_files = 5MB
log_autovacuum_min_duration = 1s
log_line_prefix = '%t [%p]: user=%u,db=%d,app=%a,client=%h '
lc_messages = 'C'

# Locales
lc_monetary = 'fr_FR.UTF-8'
lc_numeric = 'fr_FR.UTF-8'
lc_time = 'fr_FR.UTF-8'
default_text_search_config = 'pg_catalog.french'

#escape_string_warning = off
#standard_conforming_strings = off
