11# file: postgresql/defaults/main.yml
22
33# Basic settings
4- postgresql_version : 15
4+ postgresql_version : 16
55postgresql_version_terse : " {{ postgresql_version | replace('.', '') }}" # Short version of the postgresql_version, used in some path and filenames
66postgresql_encoding : " UTF-8"
77postgresql_data_checksums : false
@@ -28,9 +28,8 @@ postgresql_default_auth_method_hosts: "{{ 'scram-sha-256' if postgresql_version
2828postgresql_service_user : " {{ postgresql_admin_user }}"
2929postgresql_service_user_pgsql_profile : false
3030postgresql_service_group : " {{ postgresql_admin_user }}"
31- postgresql_service_enabled : true
3231
33- postgresql_cluster_name : " main"
32+ postgresql_cluster_name : " main" # postgres default is ''
3433postgresql_cluster_reset : false
3534
3635postgresql_database_owner : " {{ postgresql_admin_user }}"
@@ -48,6 +47,7 @@ postgresql_postgis_release_compatibility:
4847 13 : " 3.1"
4948 14 : " 3.2"
5049 15 : " 3.2"
50+ 16 : " 3.4"
5151
5252postgresql_ext_postgis_version : " {{ postgresql_postgis_release_compatibility.get(postgresql_version) }}"
5353postgresql_ext_postgis_version_terse : " {{ postgresql_ext_postgis_version | replace('.','') }}"
@@ -126,6 +126,7 @@ postgresql_listen_addresses:
126126postgresql_port : 5432
127127
128128postgresql_max_connections : 100
129+ postgresql_reserved_connections : 0 # (>= 16)
129130postgresql_superuser_reserved_connections : 3
130131
131132postgresql_unix_socket_directory : " " # (<= 9.2)
@@ -148,14 +149,16 @@ postgresql_client_connection_check_interval: 0 # (>= 14)
148149
149150# - Authentication -
150151
151- postgresql_authentication_timeout : 60s
152+ postgresql_authentication_timeout : 60s # 1s-600s
152153postgresql_password_encryption : " {{ 'scram-sha-256' if postgresql_version is version_compare('14', '>=') else 'md5' }}" # (>=14.0 set to scram-sha-256 for best security)
154+ posgresql_scram_iterations : 4096 # (>= 16)
153155postgresql_db_user_namespace : off
154156
155157# GSSAPI using Kerberos
156- postgresql_krb_server_keyfile : " "
158+ postgresql_krb_server_keyfile : " {{ 'FILE:${sysconfdir}/krb5.keytab' if postgresql_version is version_compare('14', '>=') else '' }} "
157159postgresql_krb_srvname : " postgres" # (<= 9.3)
158160postgresql_krb_caseins_users : off
161+ postgresql_gss_accept_delegation : off # (>= 16)
159162
160163# - SSL -
161164
@@ -192,9 +195,9 @@ postgresql_max_prepared_transactions: 0 # zero disables the feature
192195
193196# Caution: it is not advisable to set max_prepared_transactions nonzero unless
194197# you actively intend to use prepared transactions.
195- postgresql_work_mem : 1MB # min 64kB
196- postgresql_hash_mem_multiplier : 1 .0 # (>= 13)
197- postgresql_maintenance_work_mem : 16MB # min 1MB
198+ postgresql_work_mem : 4MB # min 64kB
199+ postgresql_hash_mem_multiplier : " {{ 2 .0 if postgresql_version is version_compare('15', '>=') else 1.0 }} " # (>= 13)
200+ postgresql_maintenance_work_mem : 64MB # min 1MB
198201postgresql_replacement_sort_tuples : 150000 # (>= 9.6) limits use of replacement selection sort
199202postgresql_autovacuum_work_mem : -1 # min 1MB, or -1 to use maintenance_work_mem
200203postgresql_logical_decoding_work_mem : 64MB # (>= 13)
@@ -208,7 +211,10 @@ postgresql_dynamic_shared_memory_type: "posix" # the default is the first optio
208211 # windows
209212 # mmap
210213 # use none to disable dynamic shared memory
211- postgresql_min_dynamic_shared_memory : 0MB # (>= 14) (change requires restart)
214+ postgresql_min_dynamic_shared_memory : 0MB # (>= 14) (change requires restart)
215+ postgres_vacuum_buffer_usage_limit : 256kB # (>= 16) size of vacuum and analyze buffer access strategy ring;
216+ # 0 to disable vacuum buffer access strategy;
217+ # range 128kB to 16GB
212218
213219# - Disk -
214220
@@ -217,13 +223,13 @@ postgresql_temp_file_limit: -1
217223
218224# - Kernel Resources -
219225
220- postgresql_max_files_per_process : 1000 # min 25
226+ postgresql_max_files_per_process : 1000 # min 25, (>= 13) min 64
221227
222228# - Cost-Based Vacuum Delay -
223229
224230postgresql_vacuum_cost_delay : 0 # 0-100 milliseconds
225231postgresql_vacuum_cost_page_hit : 1 # 0-10000 credits
226- postgresql_vacuum_cost_page_miss : 10 # 0-10000 credits
232+ postgresql_vacuum_cost_page_miss : " {{ 2 if postgresql_version is version_compare('14', '>=') else 10 }} " # 0-10000 credits
227233postgresql_vacuum_cost_page_dirty : 20 # 0-10000 credits
228234postgresql_vacuum_cost_limit : 200 # 1-10000 credits
229235
@@ -279,7 +285,7 @@ postgresql_min_wal_size: 80MB # (>= 9.5)
279285postgresql_checkpoint_flush_after : 0 # (>= 9.6) 0 disables,
280286 # default is 256kB on linux, 0 otherwise
281287postgresql_checkpoint_timeout : 5min # range 30s-1d
282- postgresql_checkpoint_completion_target : 0.5 # checkpoint target duration, 0.0 - 1.0
288+ postgresql_checkpoint_completion_target : " {{ 0.9 if postgresql_version is version_compare('14', '>=') else 0.5 }} " # checkpoint target duration, 0.0 - 1.0
283289postgresql_checkpoint_warning : 30s # 0 disables
284290
285291# - Prefetching during recovery -
@@ -338,15 +344,15 @@ postgresql_synchronous_standby_names: [] # '*' means 'all'
338344postgresql_synchronous_standby_num_sync : " " # >= 9.6 (NOTE: If you use the ANY/ALL syntax in v10, then note the new variable below)
339345postgresql_synchronous_standby_choose_sync : " FIRST" # >= 10
340346# number of xacts by which cleanup is delayed
341- postgresql_vacuum_defer_cleanup_age : 0
347+ postgresql_vacuum_defer_cleanup_age : 0 # (<= 15)
342348
343349# - Standby Servers -
344350# These settings are ignored on a primary server.
345351postgresql_primary_conninfo : " " # (>= 12)
346352postgresql_primary_slot_name : " " # (>= 12)
347- postgresql_promote_trigger_file : " " # (>= 12)
353+ postgresql_promote_trigger_file : " " # (>= 12, <= 15 )
348354# "on" allows queries during recovery
349- postgresql_hot_standby : off
355+ postgresql_hot_standby : on
350356# max delay before canceling queries when reading WAL from archive
351357postgresql_max_standby_archive_delay : 30s # -1 allows indefinite delay
352358# max delay before canceling queries when reading streaming WAL;
@@ -367,6 +373,7 @@ postgresql_recovery_min_apply_delay: 0 # (>= 12)
367373postgresql_max_logical_replication_workers : 4 # (>= 10) taken from max_worker_processes
368374 # (change requires restart)
369375postgresql_max_sync_workers_per_subscription : 2 # (>= 10) taken from max_logical_replication_workers
376+ postgresql_max_parallel_apply_workers_per_subscription : 2 # (>= 16) taken from max_logical_replication_workers
370377
371378# ------------------------------------------------------------------------------
372379# QUERY TUNING
@@ -389,6 +396,7 @@ postgresql_enable_parallel_hash: on # (>= 11)
389396postgresql_enable_partition_pruning : on # (>= 11)
390397postgresql_enable_partitionwise_join : off # (>= 11)
391398postgresql_enable_partitionwise_aggregate : off # (>= 11)
399+ postgres_enable_presorted_aggregate : on # (>= 16)
392400postgresql_enable_seqscan : on
393401postgresql_enable_sort : on
394402postgresql_enable_tidscan : on
@@ -404,11 +412,16 @@ postgresql_parallel_setup_cost: 1000.0 # same scale as above (>= 9.6)
404412postgresql_min_parallel_relation_size : 8MB # (= 9.6) replaced by below two parameters in 10
405413postgresql_min_parallel_table_scan_size : 8MB # (>= 10)
406414postgresql_min_parallel_index_scan_size : 512kB # (>= 10)
407- postgresql_effective_cache_size : 128MB
415+ postgresql_effective_cache_size : 4GB
408416
409- postgresql_jit_above_cost : 100000 # perform JIT compilation if available
410- postgresql_jit_inline_above_cost : 500000 # inline small functions if query is
411- postgresql_jit_optimize_above_cost : 500000 # use expensive JIT optimizations if
417+ postgresql_jit_above_cost : 100000 # (>= 11) perform JIT compilation if available
418+ # and query more expensive than this;
419+ # -1 disables
420+ postgresql_jit_inline_above_cost : 500000 # (>= 11) inline small functions if query is
421+ # more expensive than this; -1 disables
422+ postgresql_jit_optimize_above_cost : 500000 # (>= 11) use expensive JIT optimizations if
423+ # query is more expensive than this;
424+ # -1 disables
412425
413426# - Genetic Query Optimizer -
414427postgresql_geqo : on
@@ -424,7 +437,7 @@ postgresql_default_statistics_target: 100 # range 1-10000
424437postgresql_constraint_exclusion : " partition" # on, off, or partition
425438postgresql_cursor_tuple_fraction : 0.1 # range 0.0-1.0
426439postgresql_from_collapse_limit : 8
427- postgresql_jit : on # (>= 11: off, 12: on)
440+ postgresql_jit : on # (>= 11: off, >= 12: on)
428441postgresql_join_collapse_limit : 8 # 1 disables collapsing of explicit
429442postgresql_force_parallel_mode : off # on, off, regress (>= 9.6 <= 13)
430443postgresql_plan_cache_mode : " auto" # (>= 12)
@@ -444,7 +457,7 @@ postgresql_logging_collector: off
444457
445458# These are only used if logging_collector is on:
446459# Directory where log files are written, can be absolute or relative to PGDATA
447- postgresql_log_directory : " pg_log "
460+ postgresql_log_directory : " log "
448461# Log file name pattern, can include strftime() escapes
449462postgresql_log_filename : " postgresql-%Y-%m-%d_%H%M%S.log"
450463postgresql_log_file_mode : " 0600" # begin with 0 to use octal notation
@@ -513,8 +526,8 @@ postgresql_debug_print_parse: off
513526postgresql_debug_print_rewritten : off
514527postgresql_debug_print_plan : off
515528postgresql_debug_pretty_print : on
516- postgresql_log_autovacuum_min_duration : -1
517- postgresql_log_checkpoints : off
529+ postgresql_log_autovacuum_min_duration : " {{ '10min' if postgresql_version is version_compare('15', '>=') else -1 }} "
530+ postgresql_log_checkpoints : " {{ 'on' if postgresql_version is version_compare('15', '>=') else ' off' }} "
518531postgresql_log_connections : off
519532postgresql_log_disconnections : off
520533postgresql_log_duration : off
@@ -544,7 +557,7 @@ postgresql_log_hostname: off
544557# processes
545558# %% = '%'
546559# e.g. '<%u%%%d> '
547- postgresql_log_line_prefix : " %t "
560+ postgresql_log_line_prefix : " %m [%p] "
548561
549562# log lock waits >= deadlock_timeout
550563postgresql_log_lock_waits : off
@@ -575,7 +588,7 @@ postgresql_track_counts: on
575588postgresql_track_io_timing : off # (>= 9.2)
576589postgresql_track_wal_io_timing : off # (>= 14)
577590postgresql_track_functions : " none" # none, pl, all
578- postgresql_stats_fetch_consistency : cache # (>= 15)
591+ postgresql_stats_fetch_consistency : cache # (>= 15) cache, none, snapshot
579592postgresql_stats_temp_directory : " pg_stat_tmp" # (<= 14)
580593
581594# - Monitoring -
@@ -641,7 +654,7 @@ postgresql_row_security: on # (>= 9.5)
641654postgresql_default_tablespace : " " # a tablespace name, "" uses the default
642655postgresql_default_toast_compression : " pglz" # (>= 14) 'pglz' or 'lz4'
643656postgresql_temp_tablespaces : [] # a list of tablespace names
644- postgresql_default_table_access_method : " heap"
657+ postgresql_default_table_access_method : " heap" # (>= 12)
645658postgresql_tablespaces_dirs : [] # a list of directories for tablespaces to be created
646659
647660postgresql_check_function_bodies : on
@@ -665,23 +678,24 @@ postgresql_bytea_output: "hex" # hex, escape
665678postgresql_xmlbinary : " base64"
666679postgresql_xmloption : " content"
667680postgresql_gin_pending_list_limit : 4MB # (>= 9.5)
681+ postgresql_createrole_self_grant : ' ' # (>= 16) 'set', 'inherit' or 'set, inherit'
668682
669683# - Locale and Formatting -
670684
671685postgresql_datestyle :
672686 - " iso"
673687 - " mdy"
674688postgresql_intervalstyle : " postgres"
675- postgresql_timezone : " UTC"
689+ postgresql_timezone : " UTC" # postgres default is GMT
676690
677691# Select the set of available time zone abbreviations. Currently, there are:
678692# Default
679693# Australia
680694# India
681695# You can create your own file in `share/timezonesets/`.
682696postgresql_timezone_abbreviations : " Default"
683-
684- postgresql_extra_float_digits : 0 # min -15, max 3
697+ # min -15, max 3; (>= 12) any value >0 actually selects precise output mode
698+ postgresql_extra_float_digits : " {{ 1 if postgresql_version is version_compare('12', '>=') else 0 }} "
685699postgresql_client_encoding : false # actually defaults to database encoding
686700 # 'sql_ascii', 'UTF8', ...
687701
@@ -695,22 +709,26 @@ postgresql_lc_numeric: "{{ postgresql_locale }}"
695709# locale for time formatting
696710postgresql_lc_time : " {{ postgresql_locale }}"
697711
712+ postgresql_icu_validation_level : " warning" # (>= 16) report ICU locale validation
713+ # errors at the given level
714+
698715# default configuration for text search
699- postgresql_default_text_search_config : " pg_catalog.english"
716+ postgresql_default_text_search_config : " pg_catalog.english" # default is 'pg_catalog.simple'
700717
701718# - Shared Library Preloading -
702719
703720postgresql_local_preload_libraries : []
704721postgresql_session_preload_libraries : []
705722postgresql_shared_preload_libraries : []
706- postgresql_jit_provider : " llvmjit"
723+ postgresql_jit_provider : " llvmjit" # (>= 11)
707724
708725# - Other Defaults -
709726
710727postgresql_dynamic_library_path : " $libdir"
711- postgresql_extension_destdir : " " # (>= 14)
728+ postgresql_extension_destdir : " " # prepend path when loading extensions
729+ # and shared objects (added by Debian)
712730
713- postgresql_gin_fuzzy_search_limit : 0 # (<= 9.2)
731+ postgresql_gin_fuzzy_search_limit : 0
714732
715733# ------------------------------------------------------------------------------
716734# LOCK MANAGEMENT
@@ -759,7 +777,7 @@ postgresql_exit_on_error: off
759777# Reinitialize after backend crash?
760778postgresql_restart_after_crash : on
761779# Retry or panic on failure to fsync data?
762- postgresql_data_sync_retry : off
780+ postgresql_data_sync_retry : off # (>= 11)
763781postgresql_recovery_init_sync_method : fsync # (>= 14) fsync, syncfs (Linux 5.8+)
764782
765783# ------------------------------------------------------------------------------
0 commit comments