# Default data directory.
#data_directory = '/var/lib/postgresql/%v/%c'

# Default directory for transaction logs
#waldir = '/var/lib/postgresql/xlog/%v/%c/pg_xlog'

# Options to pass to initdb.
#initdb_options = '--data-checksums'

# The following options are copied into the new cluster's postgresql.conf:

# what IP address(es) to listen on
listen_addresses = '*'

# We use 80 % of checkpoint_timeout to write a checkpoint
checkpoint_completion_target = 0.8

# Log to syslog as well
log_destination = 'stderr,syslog'

# Tag syslog ident with cluster name
syslog_ident = 'postgres-%v-%c'

# Add prefix to log lines
log_line_prefix = '%%m [%%p] user=%u,db=%d,app=%a,client=%h '

# Use C.UTF-8 as lc_messages to ensure pgBadger is able to parse the log
lc_messages = 'C.UTF-8'

# Log slow statements
log_min_duration_statement = 1s

# Always log checkpoint information
log_checkpoints = on

# Log lock waits to debug locking errors
log_lock_waits = on

# Log temp files greater than 10 MB
log_temp_files = 10MB

# Log autovacuum processes longer then 3 minutes
log_autovacuum_min_duration = 3min

# Install lib for pg_stat_statements
shared_preload_libraries = 'pg_stat_statements, auto_explain'

# Backup
#archive_command = '/usr/share/elephant-shed/pgbackrest-archivecommand --stanza=%v-%c archive-push %%p'
archive_command = '/bin/true'
archive_mode = on
hot_standby = on
max_wal_senders = 5
max_replication_slots = 5
wal_level = hot_standby
