1
1
# file: postgresql/defaults/main.yml
2
2
3
3
# Basic settings
4
- postgresql_version : 15
4
+ postgresql_version : 16
5
5
postgresql_version_terse : " {{ postgresql_version | replace('.', '') }}" # Short version of the postgresql_version, used in some path and filenames
6
6
postgresql_encoding : " UTF-8"
7
7
postgresql_data_checksums : false
@@ -28,9 +28,8 @@ postgresql_default_auth_method_hosts: "{{ 'scram-sha-256' if postgresql_version
28
28
postgresql_service_user : " {{ postgresql_admin_user }}"
29
29
postgresql_service_user_pgsql_profile : false
30
30
postgresql_service_group : " {{ postgresql_admin_user }}"
31
- postgresql_service_enabled : true
32
31
33
- postgresql_cluster_name : " main"
32
+ postgresql_cluster_name : " main" # postgres default is ''
34
33
postgresql_cluster_reset : false
35
34
36
35
postgresql_database_owner : " {{ postgresql_admin_user }}"
@@ -48,6 +47,7 @@ postgresql_postgis_release_compatibility:
48
47
13 : " 3.1"
49
48
14 : " 3.2"
50
49
15 : " 3.2"
50
+ 16 : " 3.4"
51
51
52
52
postgresql_ext_postgis_version : " {{ postgresql_postgis_release_compatibility.get(postgresql_version) }}"
53
53
postgresql_ext_postgis_version_terse : " {{ postgresql_ext_postgis_version | replace('.','') }}"
@@ -126,6 +126,7 @@ postgresql_listen_addresses:
126
126
postgresql_port : 5432
127
127
128
128
postgresql_max_connections : 100
129
+ postgresql_reserved_connections : 0 # (>= 16)
129
130
postgresql_superuser_reserved_connections : 3
130
131
131
132
postgresql_unix_socket_directory : " " # (<= 9.2)
@@ -148,14 +149,16 @@ postgresql_client_connection_check_interval: 0 # (>= 14)
148
149
149
150
# - Authentication -
150
151
151
- postgresql_authentication_timeout : 60s
152
+ postgresql_authentication_timeout : 60s # 1s-600s
152
153
postgresql_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)
153
155
postgresql_db_user_namespace : off
154
156
155
157
# 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 '' }} "
157
159
postgresql_krb_srvname : " postgres" # (<= 9.3)
158
160
postgresql_krb_caseins_users : off
161
+ postgresql_gss_accept_delegation : off # (>= 16)
159
162
160
163
# - SSL -
161
164
@@ -192,9 +195,9 @@ postgresql_max_prepared_transactions: 0 # zero disables the feature
192
195
193
196
# Caution: it is not advisable to set max_prepared_transactions nonzero unless
194
197
# 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
198
201
postgresql_replacement_sort_tuples : 150000 # (>= 9.6) limits use of replacement selection sort
199
202
postgresql_autovacuum_work_mem : -1 # min 1MB, or -1 to use maintenance_work_mem
200
203
postgresql_logical_decoding_work_mem : 64MB # (>= 13)
@@ -208,7 +211,10 @@ postgresql_dynamic_shared_memory_type: "posix" # the default is the first optio
208
211
# windows
209
212
# mmap
210
213
# 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
212
218
213
219
# - Disk -
214
220
@@ -217,13 +223,13 @@ postgresql_temp_file_limit: -1
217
223
218
224
# - Kernel Resources -
219
225
220
- postgresql_max_files_per_process : 1000 # min 25
226
+ postgresql_max_files_per_process : 1000 # min 25, (>= 13) min 64
221
227
222
228
# - Cost-Based Vacuum Delay -
223
229
224
230
postgresql_vacuum_cost_delay : 0 # 0-100 milliseconds
225
231
postgresql_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
227
233
postgresql_vacuum_cost_page_dirty : 20 # 0-10000 credits
228
234
postgresql_vacuum_cost_limit : 200 # 1-10000 credits
229
235
@@ -279,7 +285,7 @@ postgresql_min_wal_size: 80MB # (>= 9.5)
279
285
postgresql_checkpoint_flush_after : 0 # (>= 9.6) 0 disables,
280
286
# default is 256kB on linux, 0 otherwise
281
287
postgresql_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
283
289
postgresql_checkpoint_warning : 30s # 0 disables
284
290
285
291
# - Prefetching during recovery -
@@ -338,15 +344,15 @@ postgresql_synchronous_standby_names: [] # '*' means 'all'
338
344
postgresql_synchronous_standby_num_sync : " " # >= 9.6 (NOTE: If you use the ANY/ALL syntax in v10, then note the new variable below)
339
345
postgresql_synchronous_standby_choose_sync : " FIRST" # >= 10
340
346
# number of xacts by which cleanup is delayed
341
- postgresql_vacuum_defer_cleanup_age : 0
347
+ postgresql_vacuum_defer_cleanup_age : 0 # (<= 15)
342
348
343
349
# - Standby Servers -
344
350
# These settings are ignored on a primary server.
345
351
postgresql_primary_conninfo : " " # (>= 12)
346
352
postgresql_primary_slot_name : " " # (>= 12)
347
- postgresql_promote_trigger_file : " " # (>= 12)
353
+ postgresql_promote_trigger_file : " " # (>= 12, <= 15 )
348
354
# "on" allows queries during recovery
349
- postgresql_hot_standby : off
355
+ postgresql_hot_standby : on
350
356
# max delay before canceling queries when reading WAL from archive
351
357
postgresql_max_standby_archive_delay : 30s # -1 allows indefinite delay
352
358
# max delay before canceling queries when reading streaming WAL;
@@ -367,6 +373,7 @@ postgresql_recovery_min_apply_delay: 0 # (>= 12)
367
373
postgresql_max_logical_replication_workers : 4 # (>= 10) taken from max_worker_processes
368
374
# (change requires restart)
369
375
postgresql_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
370
377
371
378
# ------------------------------------------------------------------------------
372
379
# QUERY TUNING
@@ -389,6 +396,7 @@ postgresql_enable_parallel_hash: on # (>= 11)
389
396
postgresql_enable_partition_pruning : on # (>= 11)
390
397
postgresql_enable_partitionwise_join : off # (>= 11)
391
398
postgresql_enable_partitionwise_aggregate : off # (>= 11)
399
+ postgres_enable_presorted_aggregate : on # (>= 16)
392
400
postgresql_enable_seqscan : on
393
401
postgresql_enable_sort : on
394
402
postgresql_enable_tidscan : on
@@ -404,11 +412,16 @@ postgresql_parallel_setup_cost: 1000.0 # same scale as above (>= 9.6)
404
412
postgresql_min_parallel_relation_size : 8MB # (= 9.6) replaced by below two parameters in 10
405
413
postgresql_min_parallel_table_scan_size : 8MB # (>= 10)
406
414
postgresql_min_parallel_index_scan_size : 512kB # (>= 10)
407
- postgresql_effective_cache_size : 128MB
415
+ postgresql_effective_cache_size : 4GB
408
416
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
412
425
413
426
# - Genetic Query Optimizer -
414
427
postgresql_geqo : on
@@ -424,7 +437,7 @@ postgresql_default_statistics_target: 100 # range 1-10000
424
437
postgresql_constraint_exclusion : " partition" # on, off, or partition
425
438
postgresql_cursor_tuple_fraction : 0.1 # range 0.0-1.0
426
439
postgresql_from_collapse_limit : 8
427
- postgresql_jit : on # (>= 11: off, 12: on)
440
+ postgresql_jit : on # (>= 11: off, >= 12: on)
428
441
postgresql_join_collapse_limit : 8 # 1 disables collapsing of explicit
429
442
postgresql_force_parallel_mode : off # on, off, regress (>= 9.6 <= 13)
430
443
postgresql_plan_cache_mode : " auto" # (>= 12)
@@ -444,7 +457,7 @@ postgresql_logging_collector: off
444
457
445
458
# These are only used if logging_collector is on:
446
459
# Directory where log files are written, can be absolute or relative to PGDATA
447
- postgresql_log_directory : " pg_log "
460
+ postgresql_log_directory : " log "
448
461
# Log file name pattern, can include strftime() escapes
449
462
postgresql_log_filename : " postgresql-%Y-%m-%d_%H%M%S.log"
450
463
postgresql_log_file_mode : " 0600" # begin with 0 to use octal notation
@@ -513,8 +526,8 @@ postgresql_debug_print_parse: off
513
526
postgresql_debug_print_rewritten : off
514
527
postgresql_debug_print_plan : off
515
528
postgresql_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' }} "
518
531
postgresql_log_connections : off
519
532
postgresql_log_disconnections : off
520
533
postgresql_log_duration : off
@@ -544,7 +557,7 @@ postgresql_log_hostname: off
544
557
# processes
545
558
# %% = '%'
546
559
# e.g. '<%u%%%d> '
547
- postgresql_log_line_prefix : " %t "
560
+ postgresql_log_line_prefix : " %m [%p] "
548
561
549
562
# log lock waits >= deadlock_timeout
550
563
postgresql_log_lock_waits : off
@@ -575,7 +588,7 @@ postgresql_track_counts: on
575
588
postgresql_track_io_timing : off # (>= 9.2)
576
589
postgresql_track_wal_io_timing : off # (>= 14)
577
590
postgresql_track_functions : " none" # none, pl, all
578
- postgresql_stats_fetch_consistency : cache # (>= 15)
591
+ postgresql_stats_fetch_consistency : cache # (>= 15) cache, none, snapshot
579
592
postgresql_stats_temp_directory : " pg_stat_tmp" # (<= 14)
580
593
581
594
# - Monitoring -
@@ -641,7 +654,7 @@ postgresql_row_security: on # (>= 9.5)
641
654
postgresql_default_tablespace : " " # a tablespace name, "" uses the default
642
655
postgresql_default_toast_compression : " pglz" # (>= 14) 'pglz' or 'lz4'
643
656
postgresql_temp_tablespaces : [] # a list of tablespace names
644
- postgresql_default_table_access_method : " heap"
657
+ postgresql_default_table_access_method : " heap" # (>= 12)
645
658
postgresql_tablespaces_dirs : [] # a list of directories for tablespaces to be created
646
659
647
660
postgresql_check_function_bodies : on
@@ -665,23 +678,24 @@ postgresql_bytea_output: "hex" # hex, escape
665
678
postgresql_xmlbinary : " base64"
666
679
postgresql_xmloption : " content"
667
680
postgresql_gin_pending_list_limit : 4MB # (>= 9.5)
681
+ postgresql_createrole_self_grant : ' ' # (>= 16) 'set', 'inherit' or 'set, inherit'
668
682
669
683
# - Locale and Formatting -
670
684
671
685
postgresql_datestyle :
672
686
- " iso"
673
687
- " mdy"
674
688
postgresql_intervalstyle : " postgres"
675
- postgresql_timezone : " UTC"
689
+ postgresql_timezone : " UTC" # postgres default is GMT
676
690
677
691
# Select the set of available time zone abbreviations. Currently, there are:
678
692
# Default
679
693
# Australia
680
694
# India
681
695
# You can create your own file in `share/timezonesets/`.
682
696
postgresql_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 }} "
685
699
postgresql_client_encoding : false # actually defaults to database encoding
686
700
# 'sql_ascii', 'UTF8', ...
687
701
@@ -695,22 +709,26 @@ postgresql_lc_numeric: "{{ postgresql_locale }}"
695
709
# locale for time formatting
696
710
postgresql_lc_time : " {{ postgresql_locale }}"
697
711
712
+ postgresql_icu_validation_level : " warning" # (>= 16) report ICU locale validation
713
+ # errors at the given level
714
+
698
715
# 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'
700
717
701
718
# - Shared Library Preloading -
702
719
703
720
postgresql_local_preload_libraries : []
704
721
postgresql_session_preload_libraries : []
705
722
postgresql_shared_preload_libraries : []
706
- postgresql_jit_provider : " llvmjit"
723
+ postgresql_jit_provider : " llvmjit" # (>= 11)
707
724
708
725
# - Other Defaults -
709
726
710
727
postgresql_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)
712
730
713
- postgresql_gin_fuzzy_search_limit : 0 # (<= 9.2)
731
+ postgresql_gin_fuzzy_search_limit : 0
714
732
715
733
# ------------------------------------------------------------------------------
716
734
# LOCK MANAGEMENT
@@ -759,7 +777,7 @@ postgresql_exit_on_error: off
759
777
# Reinitialize after backend crash?
760
778
postgresql_restart_after_crash : on
761
779
# Retry or panic on failure to fsync data?
762
- postgresql_data_sync_retry : off
780
+ postgresql_data_sync_retry : off # (>= 11)
763
781
postgresql_recovery_init_sync_method : fsync # (>= 14) fsync, syncfs (Linux 5.8+)
764
782
765
783
# ------------------------------------------------------------------------------
0 commit comments