]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blame - templates/postgresql.12.conf.j2
recovery: optional restore_command & allow custom command if needed
[github/fretlink/ansible-postgresql-role.git] / templates / postgresql.12.conf.j2
CommitLineData
8d168915
P
1# {{ ansible_managed }}
2# -----------------------------
3# PostgreSQL configuration file
4# -----------------------------
5#
6# This file consists of lines of the form:
7#
8# name = value
9#
10# (The "=" is optional.) Whitespace may be used. Comments are introduced with
11# "#" anywhere on a line. The complete list of parameter names and allowed
12# values can be found in the PostgreSQL documentation.
13#
14# The commented-out settings shown in this file represent the default values.
15# Re-commenting a setting is NOT sufficient to revert it to the default value;
16# you need to reload the server.
17#
18# This file is read on server startup and when the server receives a SIGHUP
19# signal. If you edit the file on a running system, you have to SIGHUP the
20# server for the changes to take effect, run "pg_ctl reload", or execute
21# "SELECT pg_reload_conf()". Some parameters, which are marked below,
22# require a server shutdown and restart to take effect.
23#
24# Any parameter can also be given as a command-line option to the server, e.g.,
25# "postgres -c log_connections=on". Some parameters can be changed at run time
26# with the "SET" SQL command.
27#
28# Memory units: kB = kilobytes Time units: ms = milliseconds
29# MB = megabytes s = seconds
30# GB = gigabytes min = minutes
31# TB = terabytes h = hours
32# d = days
33
34
35#------------------------------------------------------------------------------
36# FILE LOCATIONS
37#------------------------------------------------------------------------------
38
39# The default values of these variables are driven from the -D command-line
40# option or PGDATA environment variable, represented here as ConfigDir.
41
42data_directory = '/var/lib/postgresql/{{ postgres_version }}/{{ postgres_cluster_name }}' # use data in another directory
43 # (change requires restart)
44hba_file = '/etc/postgresql/{{ postgres_version }}/{{ postgres_cluster_name }}/pg_hba.conf' # host-based authentication file
45 # (change requires restart)
46ident_file = '/etc/postgresql/{{ postgres_version }}/{{ postgres_cluster_name }}/pg_ident.conf' # ident configuration file
47 # (change requires restart)
48
49# If external_pid_file is not explicitly set, no extra PID file is written.
50external_pid_file = '/var/run/postgresql/{{ postgres_version }}-{{ postgres_cluster_name }}.pid' # write an extra PID file
51 # (change requires restart)
52
53
54#------------------------------------------------------------------------------
55# CONNECTIONS AND AUTHENTICATION
56#------------------------------------------------------------------------------
57
58# - Connection Settings -
59
60listen_addresses = '{{ postgres_listen_addresses | reject("none") | join(",") }}' # what IP address(es) to listen on;
61 # comma-separated list of addresses;
62 # defaults to 'localhost'; use '*' for all
63 # (change requires restart)
64port = {{ postgres_port }} # (change requires restart)
65max_connections = 400 # (change requires restart)
66#superuser_reserved_connections = 3 # (change requires restart)
67unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
68 # (change requires restart)
69#unix_socket_group = '' # (change requires restart)
70#unix_socket_permissions = 0777 # begin with 0 to use octal notation
71 # (change requires restart)
72#bonjour = off # advertise server via Bonjour
73 # (change requires restart)
74#bonjour_name = '' # defaults to the computer name
75 # (change requires restart)
76
77# - TCP settings -
78# see "man 7 tcp" for details
79
80#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
81 # 0 selects the system default
82#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
83 # 0 selects the system default
84#tcp_keepalives_count = 0 # TCP_KEEPCNT;
85 # 0 selects the system default
86#tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds;
87 # 0 selects the system default
88
89# - Authentication -
90
91#authentication_timeout = 1min # 1s-600s
92#password_encryption = md5 # md5 or scram-sha-256
93#db_user_namespace = off
94
95# GSSAPI using Kerberos
96#krb_server_keyfile = ''
97#krb_caseins_users = off
98
99# - SSL -
100
101ssl = on
102#ssl_ca_file = ''
103#ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
104#ssl_crl_file = ''
105#ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'
106#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
107#ssl_prefer_server_ciphers = on
108#ssl_ecdh_curve = 'prime256v1'
109#ssl_min_protocol_version = 'TLSv1'
110#ssl_max_protocol_version = ''
111#ssl_dh_params_file = ''
112#ssl_passphrase_command = ''
113#ssl_passphrase_command_supports_reload = off
114
115
116#------------------------------------------------------------------------------
117# RESOURCE USAGE (except WAL)
118#------------------------------------------------------------------------------
119
120# - Memory -
121
122{% if ansible_memtotal_mb > 65536 %}
123shared_buffers = 16GB # min 128kB
124{% else %}
125shared_buffers = {{ ansible_memtotal_mb // 4 }}MB # min 128kB
126{% endif %}
127 # (change requires restart)
128#huge_pages = try # on, off, or try
129 # (change requires restart)
130temp_buffers = 24MB # min 800kB
131#max_prepared_transactions = 0 # zero disables the feature
132 # (change requires restart)
133# Caution: it is not advisable to set max_prepared_transactions nonzero unless
134# you actively intend to use prepared transactions.
135work_mem = 512MB # min 64kB
136maintenance_work_mem = 1024MB # min 1MB
137#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
138#max_stack_depth = 2MB # min 100kB
139#shared_memory_type = mmap # the default is the first option
140 # supported by the operating system:
141 # mmap
142 # sysv
143 # windows
144 # (change requires restart)
145dynamic_shared_memory_type = posix # the default is the first option
146 # supported by the operating system:
147 # posix
148 # sysv
149 # windows
150 # mmap
151 # (change requires restart)
152
153# - Disk -
154
155#temp_file_limit = -1 # limits per-process temp file space
156 # in kB, or -1 for no limit
157
158# - Kernel Resources -
159
160#max_files_per_process = 1000 # min 25
161 # (change requires restart)
162
163# - Cost-Based Vacuum Delay -
164
165#vacuum_cost_delay = 0 # 0-100 milliseconds (0 disables)
166#vacuum_cost_page_hit = 1 # 0-10000 credits
167#vacuum_cost_page_miss = 10 # 0-10000 credits
168#vacuum_cost_page_dirty = 20 # 0-10000 credits
169#vacuum_cost_limit = 200 # 1-10000 credits
170
171# - Background Writer -
172
173bgwriter_delay = 2000ms # 10-10000ms between rounds
174#bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables
175#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round
176#bgwriter_flush_after = 512kB # measured in pages, 0 disables
177
178# - Asynchronous Behavior -
179
180#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching
181#max_worker_processes = 8 # (change requires restart)
182#max_parallel_maintenance_workers = 2 # taken from max_parallel_workers
183#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers
184#parallel_leader_participation = on
185#max_parallel_workers = 8 # maximum number of max_worker_processes that
186 # can be used in parallel operations
187#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate
188 # (change requires restart)
189#backend_flush_after = 0 # measured in pages, 0 disables
190
191
192#------------------------------------------------------------------------------
193# WRITE-AHEAD LOG
194#------------------------------------------------------------------------------
195
196# - Settings -
197
198wal_level = {{ postgres_wal_level }} # minimal, replica, or logical
199 # (change requires restart)
200{% if postgres_fsync_enabled %}
201#fsync = on # flush data to disk for crash safety
202 # (turning this off can cause
203 # unrecoverable data corruption)
204#synchronous_commit = on # synchronization level;
205 # off, local, remote_write, remote_apply, or on
206{% else %}
207fsync = off # turns forced synchronization on or off
208synchronous_commit = off # synchronization level;
209{% endif %}
210#wal_sync_method = fsync # the default is the first option
211 # supported by the operating system:
212 # open_datasync
213 # fdatasync (default on Linux)
214 # fsync
215 # fsync_writethrough
216 # open_sync
217#full_page_writes = on # recover from partial page writes
218#wal_compression = off # enable compression of full-page writes
219wal_log_hints = on # also do full page writes of non-critical updates
220 # (change requires restart)
221#wal_init_zero = on # zero-fill new WAL files
222#wal_recycle = on # recycle WAL files
223#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
224 # (change requires restart)
225#wal_writer_delay = 200ms # 1-10000 milliseconds
226#wal_writer_flush_after = 1MB # measured in pages, 0 disables
227
228#commit_delay = 0 # range 0-100000, in microseconds
229#commit_siblings = 5 # range 1-1000
230
231# - Checkpoints -
232
233#checkpoint_timeout = 5min # range 30s-1d
234max_wal_size = 1GB
235min_wal_size = 80MB
236#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
237#checkpoint_flush_after = 256kB # measured in pages, 0 disables
238#checkpoint_warning = 30s # 0 disables
239
240# - Archiving -
241
242{% if postgres_archive_enabled %}
243archive_mode = on
244archive_command = 'rsync -a %p barman@{{ postgres_barman_server }}:/var/lib/barman/{{ barman_directory }}/incoming/%f'
245{% else %}
246archive_mode = off
247archive_command = ''
248{% endif %}
249
250#archive_mode = off # enables archiving; off, on, or always
251 # (change requires restart)
252#archive_command = '' # command to use to archive a logfile segment
253 # placeholders: %p = path of file to archive
254 # %f = file name only
255 # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
256#archive_timeout = 0 # force a logfile segment switch after this
257 # number of seconds; 0 disables
258
259# - Archive Recovery -
260
261# These are only used in recovery mode.
262
8d168915 263{# In PG < 12 versions all the recovery settings were in a separate recovery.conf file #}
587f87bb
P
264{% if postgres_primary and postgres_primary.restore_command is defined %}
265restore_command = '{{ postgres_primary.restore_command }}' # command to use to restore an archived logfile segment
266{% elif postgres_primary and postgres_primary.restore_barman_directory is defined %}
267restore_command = '/usr/bin/barman-wal-restore --user barman --parallel 8 {{ postgres_barman_server }} {{ postgres_primary.restore_barman_directory }} %f %p' # command to use to restore an archived logfile segment
8d168915
P
268{% else %}
269#restore_command = '' # command to use to restore an archived logfile segment
587f87bb 270{% endif %}
8d168915
P
271 # placeholders: %p = path of file to restore
272 # %f = file name only
273 # e.g. 'cp /mnt/server/archivedir/%f %p'
274 # (change requires restart)
8d168915
P
275#archive_cleanup_command = '' # command to execute at every restartpoint
276#recovery_end_command = '' # command to execute at completion of recovery
277
278# - Recovery Target -
279
280# Set these only when performing a targeted recovery.
281
282#recovery_target = '' # 'immediate' to end recovery as soon as a
283 # consistent state is reached
284 # (change requires restart)
285#recovery_target_name = '' # the named restore point to which recovery will proceed
286 # (change requires restart)
287#recovery_target_time = '' # the time stamp up to which recovery will proceed
288 # (change requires restart)
289#recovery_target_xid = '' # the transaction ID up to which recovery will proceed
290 # (change requires restart)
291#recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed
292 # (change requires restart)
293#recovery_target_inclusive = on # Specifies whether to stop:
294 # just after the specified recovery target (on)
295 # just before the recovery target (off)
296 # (change requires restart)
297{% if postgres_primary %}
298{# In PG < 12 versions all the recovery settings were in a separate recovery.conf file #}
299recovery_target_timeline='latest' # 'current', 'latest', or timeline ID
300 # (change requires restart)
301{% else %}
302#recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID
303 # (change requires restart)
304{% endif %}
305#recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown'
306 # (change requires restart)
307
308#------------------------------------------------------------------------------
309# REPLICATION
310#------------------------------------------------------------------------------
311
312# - Sending Servers -
313
314# Set these on the master and on any standby that will send replication data.
315
316#max_wal_senders = 10 # max number of walsender processes
317 # (change requires restart)
318wal_keep_segments = 16 # in logfile segments; 0 disables
319#wal_sender_timeout = 60s # in milliseconds; 0 disables
320
321{% if postgres_max_replication_slots is defined %}
322max_replication_slots = {{ postgres_max_replication_slots }} # max number of replication slots
323{% else %}
324#max_replication_slots = 10 # max number of replication slots
325{% endif %}
326 # (change requires restart)
327#track_commit_timestamp = off # collect timestamp of transaction commit
328 # (change requires restart)
329
330# - Master Server -
331
332# These settings are ignored on a standby server.
333
334#synchronous_standby_names = '' # standby servers that provide sync rep
335 # method to choose sync standbys, number of sync standbys,
336 # and comma-separated list of application_name
337 # from standby(s); '*' = all
338#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
339
340# - Standby Servers -
341
342# These settings are ignored on a master server.
343
344{% if postgres_primary %}
345{# In PG < 12 versions this setting was defined in separate recovery.conf file #}
346primary_conninfo = 'host={{ postgres_primary.host }} port={{ postgres_primary.port }} user={{ postgres_primary.replication_user }} password={{ postgres_primary.replication_password }} sslmode=require' # connection string to sending server
347 # (change requires restart)
348{% else %}
349#primary_conninfo = '' # connection string to sending server
350 # (change requires restart)
351{% endif %}
352#primary_slot_name = '' # replication slot on sending server
353 # (change requires restart)
354{% if postgres_primary %}
355{# In PG < 12 versions this setting was defined in separate recovery.conf file #}
356promote_trigger_file = '/var/lib/postgresql/{{ postgres_version }}/{{ postgres_cluster_name }}/failover.trigger' # file name whose presence ends recovery
357{% else %}
358#promote_trigger_file = '' # file name whose presence ends recovery
359{% endif %}
360hot_standby = on # "off" disallows queries during recovery
361 # (change requires restart)
362#max_standby_archive_delay = 30s # max delay before canceling queries
363 # when reading WAL from archive;
364 # -1 allows indefinite delay
365max_standby_streaming_delay = {{ postgres_extra_config.max_standby_streaming_delay | default('600s') }} # max delay before canceling queries
366 # when reading streaming WAL;
367 # -1 allows indefinite delay
368#wal_receiver_status_interval = 10s # send replies at least this often
369 # 0 disables
370#hot_standby_feedback = off # send info from standby to prevent
371 # query conflicts
372#wal_receiver_timeout = 60s # time that receiver waits for
373 # communication from master
374 # in milliseconds; 0 disables
375#wal_retrieve_retry_interval = 5s # time to wait before retrying to
376 # retrieve WAL after a failed attempt
377#recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery
378
379# - Subscribers -
380
381# These settings are ignored on a publisher.
382
383#max_logical_replication_workers = 4 # taken from max_worker_processes
384 # (change requires restart)
385#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers
386
387
388#------------------------------------------------------------------------------
389# QUERY TUNING
390#------------------------------------------------------------------------------
391
392# - Planner Method Configuration -
393
394#enable_bitmapscan = on
395#enable_hashagg = on
396#enable_hashjoin = on
397#enable_indexscan = on
398#enable_indexonlyscan = on
399#enable_material = on
400#enable_mergejoin = on
401#enable_nestloop = on
402#enable_parallel_append = on
403#enable_seqscan = on
404#enable_sort = on
405#enable_tidscan = on
406#enable_partitionwise_join = off
407#enable_partitionwise_aggregate = off
408#enable_parallel_hash = on
409#enable_partition_pruning = on
410
411# - Planner Cost Constants -
412
413#seq_page_cost = 1.0 # measured on an arbitrary scale
414{% if postgres_specific_random_page_cost is defined -%}
415# Random page cost is an arbitrary value relative to the seq_page_cost conf (default 1.0)
416# On SSD disk it is better to lower the default value from 4.0 to 1.0 for instance.
417random_page_cost = {{ postgres_specific_random_page_cost }} # same scale as above
418{% else -%}
419#random_page_cost = 4.0 # same scale as above
420{% endif %}
421#cpu_tuple_cost = 0.01 # same scale as above
422#cpu_index_tuple_cost = 0.005 # same scale as above
423#cpu_operator_cost = 0.0025 # same scale as above
424#parallel_tuple_cost = 0.1 # same scale as above
425#parallel_setup_cost = 1000.0 # same scale as above
426
427#jit_above_cost = 100000 # perform JIT compilation if available
428 # and query more expensive than this;
429 # -1 disables
430#jit_inline_above_cost = 500000 # inline small functions if query is
431 # more expensive than this; -1 disables
432#jit_optimize_above_cost = 500000 # use expensive JIT optimizations if
433 # query is more expensive than this;
434 # -1 disables
435
436#min_parallel_table_scan_size = 8MB
437#min_parallel_index_scan_size = 512kB
438#effective_cache_size = 4GB
439effective_cache_size = {{ ansible_memtotal_mb // 2 }}MB
440
441# - Genetic Query Optimizer -
442
443#geqo = on
444#geqo_threshold = 12
445#geqo_effort = 5 # range 1-10
446#geqo_pool_size = 0 # selects default based on effort
447#geqo_generations = 0 # selects default based on effort
448#geqo_selection_bias = 2.0 # range 1.5-2.0
449#geqo_seed = 0.0 # range 0.0-1.0
450
451# - Other Planner Options -
452
453#default_statistics_target = 100 # range 1-10000
454#constraint_exclusion = partition # on, off, or partition
455#cursor_tuple_fraction = 0.1 # range 0.0-1.0
456#from_collapse_limit = 8
457#join_collapse_limit = 8 # 1 disables collapsing of explicit
458 # JOIN clauses
459#force_parallel_mode = off
460#jit = on # allow JIT compilation
461#plan_cache_mode = auto # auto, force_generic_plan or
462 # force_custom_plan
463
464
465#------------------------------------------------------------------------------
466# REPORTING AND LOGGING
467#------------------------------------------------------------------------------
468
469# - Where to Log -
470
471#log_destination = 'stderr' # Valid values are combinations of
472 # stderr, csvlog, syslog, and eventlog,
473 # depending on platform. csvlog
474 # requires logging_collector to be on.
475
476# This is used when logging to stderr:
477#logging_collector = off # Enable capturing of stderr and csvlog
478 # into log files. Required to be on for
479 # csvlogs.
480 # (change requires restart)
481
482# These are only used if logging_collector is on:
483#log_directory = 'log' # directory where log files are written,
484 # can be absolute or relative to PGDATA
485#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
486 # can include strftime() escapes
487#log_file_mode = 0600 # creation mode for log files,
488 # begin with 0 to use octal notation
489#log_truncate_on_rotation = off # If on, an existing log file with the
490 # same name as the new log file will be
491 # truncated rather than appended to.
492 # But such truncation only occurs on
493 # time-driven rotation, not on restarts
494 # or size-driven rotation. Default is
495 # off, meaning append to existing files
496 # in all cases.
497#log_rotation_age = 1d # Automatic rotation of logfiles will
498 # happen after that time. 0 disables.
499#log_rotation_size = 10MB # Automatic rotation of logfiles will
500 # happen after that much log output.
501 # 0 disables.
502
503# These are relevant when logging to syslog:
504#syslog_facility = 'LOCAL0'
505#syslog_ident = 'postgres'
506#syslog_sequence_numbers = on
507#syslog_split_messages = on
508
509# This is only relevant when logging to eventlog (win32):
510# (change requires restart)
511#event_source = 'PostgreSQL'
512
513# - When to Log -
514
515#log_min_messages = warning # values in order of decreasing detail:
516 # debug5
517 # debug4
518 # debug3
519 # debug2
520 # debug1
521 # info
522 # notice
523 # warning
524 # error
525 # log
526 # fatal
527 # panic
528
529#log_min_error_statement = error # values in order of decreasing detail:
530 # debug5
531 # debug4
532 # debug3
533 # debug2
534 # debug1
535 # info
536 # notice
537 # warning
538 # error
539 # log
540 # fatal
541 # panic (effectively off)
542
543log_min_duration_statement = 10000 # -1 is disabled, 0 logs all statements
544 # and their durations, > 0 logs only
545 # statements running at least this number
546 # of milliseconds
547
548#log_transaction_sample_rate = 0.0 # Fraction of transactions whose statements
549 # are logged regardless of their duration. 1.0 logs all
550 # statements from all transactions, 0.0 never logs.
551
552# - What to Log -
553
554#debug_print_parse = off
555#debug_print_rewritten = off
556#debug_print_plan = off
557#debug_pretty_print = on
558#log_checkpoints = off
559#log_connections = off
560#log_disconnections = off
561#log_duration = off
562#log_error_verbosity = default # terse, default, or verbose messages
563#log_hostname = off
564
565log_line_prefix = '{{ postgres_log_line_prefix }}'
566#log_line_prefix = '%m [%p] %q%u@%d ' # special values:
567 # %a = application name
568 # %u = user name
569 # %d = database name
570 # %r = remote host and port
571 # %h = remote host
572 # %p = process ID
573 # %t = timestamp without milliseconds
574 # %m = timestamp with milliseconds
575 # %n = timestamp with milliseconds (as a Unix epoch)
576 # %i = command tag
577 # %e = SQL state
578 # %c = session ID
579 # %l = session line number
580 # %s = session start timestamp
581 # %v = virtual transaction ID
582 # %x = transaction ID (0 if none)
583 # %q = stop here in non-session
584 # processes
585 # %% = '%'
586 # e.g. '<%u%%%d> '
587#log_lock_waits = off # log lock waits >= deadlock_timeout
588#log_statement = 'none' # none, ddl, mod, all
589#log_replication_commands = off
590#log_temp_files = -1 # log temporary files equal or larger
591 # than the specified size in kilobytes;
592 # -1 disables, 0 logs all temp files
593log_timezone = 'UTC'
594
595#------------------------------------------------------------------------------
596# PROCESS TITLE
597#------------------------------------------------------------------------------
598
599cluster_name = '{{ postgres_version }}/{{ postgres_cluster_name }}' # added to process titles if nonempty
600 # (change requires restart)
601#update_process_title = on
602
603
604#------------------------------------------------------------------------------
605# STATISTICS
606#------------------------------------------------------------------------------
607
608# - Query and Index Statistics Collector -
609
610#track_activities = on
611#track_counts = on
612#track_io_timing = off
613#track_functions = none # none, pl, all
614#track_activity_query_size = 1024 # (change requires restart)
615stats_temp_directory = '/var/run/postgresql/{{ postgres_version }}-{{ postgres_cluster_name }}.pg_stat_tmp'
616
617
618# - Monitoring -
619
620#log_parser_stats = off
621#log_planner_stats = off
622#log_executor_stats = off
623#log_statement_stats = off
624
625
626#------------------------------------------------------------------------------
627# AUTOVACUUM
628#------------------------------------------------------------------------------
629
630#autovacuum = on # Enable autovacuum subprocess? 'on'
631 # requires track_counts to also be on.
632#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
633 # their durations, > 0 logs only
634 # actions running at least this number
635 # of milliseconds.
636#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
637 # (change requires restart)
638#autovacuum_naptime = 1min # time between autovacuum runs
639#autovacuum_vacuum_threshold = 50 # min number of row updates before
640 # vacuum
641#autovacuum_analyze_threshold = 50 # min number of row updates before
642 # analyze
643#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
644#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
645#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
646 # (change requires restart)
647#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
648 # before forced vacuum
649 # (change requires restart)
650#autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for
651 # autovacuum, in milliseconds;
652 # -1 means use vacuum_cost_delay
653#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
654 # autovacuum, -1 means use
655 # vacuum_cost_limit
656
657
658#------------------------------------------------------------------------------
659# CLIENT CONNECTION DEFAULTS
660#------------------------------------------------------------------------------
661
662# - Statement Behavior -
663
664#client_min_messages = notice # values in order of decreasing detail:
665 # debug5
666 # debug4
667 # debug3
668 # debug2
669 # debug1
670 # log
671 # notice
672 # warning
673 # error
674#search_path = '"$user", public' # schema names
675#row_security = on
676#default_tablespace = '' # a tablespace name, '' uses the default
677#temp_tablespaces = '' # a list of tablespace names, '' uses
678 # only default tablespace
679#default_table_access_method = 'heap'
680#check_function_bodies = on
681#default_transaction_isolation = 'read committed'
682#default_transaction_read_only = off
683#default_transaction_deferrable = off
684#session_replication_role = 'origin'
685#statement_timeout = 0 # in milliseconds, 0 is disabled
686#lock_timeout = 0 # in milliseconds, 0 is disabled
687#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled
688#vacuum_freeze_min_age = 50000000
689#vacuum_freeze_table_age = 150000000
690#vacuum_multixact_freeze_min_age = 5000000
691#vacuum_multixact_freeze_table_age = 150000000
692#vacuum_cleanup_index_scale_factor = 0.1 # fraction of total number of tuples
693 # before index cleanup, 0 always performs
694 # index cleanup
695#bytea_output = 'hex' # hex, escape
696#xmlbinary = 'base64'
697#xmloption = 'content'
698#gin_fuzzy_search_limit = 0
699#gin_pending_list_limit = 4MB
700
701# - Locale and Formatting -
702
703datestyle = '{{ postgres_datestyle }}'
704#intervalstyle = 'postgres'
705#timezone = '(defaults to server environment setting)'
706{% if postgres_timezone is defined %}
707timezone = '{{ postgres_timezone }}'
708{% endif %}
709#timezone_abbreviations = 'Default' # Select the set of available time zone
710 # abbreviations. Currently, there are
711 # Default
712 # Australia (historical usage)
713 # India
714 # You can create your own file in
715 # share/timezonesets/.
716#extra_float_digits = 1 # min -15, max 3; any value >0 actually
717 # selects precise output mode
718#client_encoding = sql_ascii # actually, defaults to database
719 # encoding
720
721# These settings are initialized by initdb, but they can be changed.
722lc_messages = '{{ postgres_locale_system }}' # locale for system error message
723 # strings
724lc_monetary = '{{ postgres_locale_formats }}' # locale for monetary formatting
725lc_numeric = '{{ postgres_locale_formats }}' # locale for number formatting
726lc_time = '{{ postgres_locale_formats }}' # locale for time formatting
727
728# default configuration for text search
729default_text_search_config = '{{ postgres_text_search_config }}'
730
731# - Shared Library Preloading -
732
733#shared_preload_libraries = '' # (change requires restart)
734#local_preload_libraries = ''
735#session_preload_libraries = ''
736#jit_provider = 'llvmjit' # JIT library to use
737
738# - Other Defaults -
739
740#dynamic_library_path = '$libdir'
741
742
743#------------------------------------------------------------------------------
744# LOCK MANAGEMENT
745#------------------------------------------------------------------------------
746
747#deadlock_timeout = 1s
748#max_locks_per_transaction = 64 # min 10
749 # (change requires restart)
750#max_pred_locks_per_transaction = 64 # min 10
751 # (change requires restart)
752#max_pred_locks_per_relation = -2 # negative values mean
753 # (max_pred_locks_per_transaction
754 # / -max_pred_locks_per_relation) - 1
755#max_pred_locks_per_page = 2 # min 0
756
757
758#------------------------------------------------------------------------------
759# VERSION AND PLATFORM COMPATIBILITY
760#------------------------------------------------------------------------------
761
762# - Previous PostgreSQL Versions -
763
764#array_nulls = on
765#backslash_quote = safe_encoding # on, off, or safe_encoding
766#escape_string_warning = on
767#lo_compat_privileges = off
768#operator_precedence_warning = off
769#quote_all_identifiers = off
770#standard_conforming_strings = on
771#synchronize_seqscans = on
772
773# - Other Platforms and Clients -
774
775#transform_null_equals = off
776
777
778#------------------------------------------------------------------------------
779# ERROR HANDLING
780#------------------------------------------------------------------------------
781
782#exit_on_error = off # terminate session on any error?
783#restart_after_crash = on # reinitialize after backend crash?
784#data_sync_retry = off # retry or panic on failure to fsync
785 # data?
786 # (change requires restart)
787
788
789#------------------------------------------------------------------------------
790# CONFIG FILE INCLUDES
791#------------------------------------------------------------------------------
792
793# These options allow settings to be loaded from files other than the
794# default postgresql.conf. Note that these are directives, not variable
795# assignments, so they can usefully be given more than once.
796
797include_dir = 'conf.d' # include files ending in '.conf' from
798 # a directory, e.g., 'conf.d'
799#include_if_exists = '...' # include file only if it exists
800#include = '...' # include file
801
802
803#------------------------------------------------------------------------------
804# CUSTOMIZED OPTIONS
805#------------------------------------------------------------------------------
806
807# Add settings for extensions here