Skip to content

Commit 3da8097

Browse files
authored
Merge pull request #590 from tsoulabail/PG17
pg17 support
2 parents 387320b + 128e6b7 commit 3da8097

File tree

6 files changed

+1736
-5
lines changed

6 files changed

+1736
-5
lines changed

defaults/main.yml

+27-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# file: postgresql/defaults/main.yml
22

33
# Basic settings
4-
postgresql_version: 16
4+
postgresql_version: 17
55
postgresql_version_terse: "{{ postgresql_version | replace('.', '') }}" # Short version of the postgresql_version, used in some path and filenames
66
postgresql_encoding: "UTF-8"
77
postgresql_data_checksums: false
@@ -48,6 +48,7 @@ postgresql_postgis_release_compatibility:
4848
14: "3.2"
4949
15: "3.2"
5050
16: "3.4"
51+
17: "3.5"
5152

5253
postgresql_ext_postgis_version: "{{ postgresql_postgis_release_compatibility.get(postgresql_version) }}"
5354
postgresql_ext_postgis_version_terse: "{{ postgresql_ext_postgis_version | replace('.','') }}"
@@ -153,7 +154,7 @@ postgresql_client_connection_check_interval: 0 # (>= 14)
153154
postgresql_authentication_timeout: 60s # 1s-600s
154155
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)
155156
posgresql_scram_iterations: 4096 # (>= 16)
156-
postgresql_db_user_namespace: off
157+
postgresql_db_user_namespace: off # (<= 16)
157158

158159
# GSSAPI using Kerberos
159160
postgresql_krb_server_keyfile: "{{ 'FILE:${sysconfdir}/krb5.keytab' if postgresql_version is version_compare('14', '>=') else '' }}"
@@ -213,15 +214,26 @@ postgresql_dynamic_shared_memory_type: "posix" # the default is the first optio
213214
# mmap
214215
# use none to disable dynamic shared memory
215216
postgresql_min_dynamic_shared_memory: 0MB # (>= 14) (change requires restart)
216-
postgres_vacuum_buffer_usage_limit: 256kB # (>= 16) size of vacuum and analyze buffer access strategy ring;
217+
postgresql_vacuum_buffer_usage_limit: "{{ '256kB' if postgresql_version is version_compare('16', '=') else '2MB' }}" # (>= 16) size of vacuum and analyze buffer access strategy ring;
217218
# 0 to disable vacuum buffer access strategy;
218219
# range 128kB to 16GB
219220

221+
# SLRU buffers (change requires restart)
222+
postgresql_commit_timestamp_buffers: 0 # (>= 17) memory for pg_commit_ts
223+
postgresql_multixact_offset_buffers: 16 # (>= 17) memory for pg_multixact/offsets
224+
postgresql_multixact_member_buffers: 32 # (>= 17) memory for pg_multixact/members
225+
postgresql_notify_buffers: 16 # (>= 17) memory for pg_notify
226+
postgresql_serializable_buffers: 32 # (>= 17) memory for pg_serial
227+
postgresql_subtransaction_buffers: 0 # (>= 17) memory for pg_subtrans (0 = auto)
228+
postgresql_transaction_buffers: 0 # (>= 17) memory for pg_xact (0 = auto)
229+
220230
# - Disk -
221231

222232
# limits per-process temp file space in kB, or -1 for no limit (>= 9.2)
223233
postgresql_temp_file_limit: -1
224234

235+
postgresql_max_notify_queue_pages: 1048576 # (>= 17)
236+
225237
# - Kernel Resources -
226238

227239
postgresql_max_files_per_process: 1000 # min 25, (>= 13) min 64
@@ -246,12 +258,13 @@ postgresql_bgwriter_flush_after: 512kB # measured in pages, 0 disables
246258
postgresql_backend_flush_after: 0 # (>= 9.6) 0 disables, default is 0
247259
postgresql_effective_io_concurrency: 1 # 1-1000; 0 disables prefetching
248260
postgresql_maintenance_io_concurrency: 10 # (>= 13)
261+
postgresql_io_combine_limit: 128kB # (>= 17) usually 1-32 blocks (depends on OS)
249262
postgresql_max_worker_processes: 8 # (change requires restart)
250263
postgresql_max_parallel_workers_per_gather: 2 # (>= 9.6) taken from max_worker_processes
251264
postgresql_max_parallel_maintenance_workers: 2 # (>= 11) taken from max_parallel_workers
252265
postgresql_max_parallel_workers: 8 # (>= 10)
253266
postgresql_parallel_leader_participation: on # (>= 11)
254-
postgresql_old_snapshot_threshold: -1 # (>= 9.6) 1min-60d; -1 disables; 0 is immediate
267+
postgresql_old_snapshot_threshold: -1 # (>= 9.6 and <= 16) 1min-60d; -1 disables; 0 is immediate
255268
# (change requires restart)
256269

257270
#------------------------------------------------------------------------------
@@ -321,6 +334,10 @@ postgresql_recovery_target_inclusive: "" # (>= 12)
321334
postgresql_recovery_target_timeline: "latest" # (>= 12)
322335
postgresql_recovery_target_action: "pause" # (>= 12)
323336

337+
# - WAL Summarization -
338+
postgresql_summarize_wal: off # (>= 17) run WAL summarizer process?
339+
postgresql_wal_summary_keep_time: 10d # (>= 17) when to remove old summary files, 0 = never
340+
324341
#------------------------------------------------------------------------------
325342
# REPLICATION
326343
#------------------------------------------------------------------------------
@@ -342,6 +359,7 @@ postgresql_track_commit_timestamp: off # (>= 9.5)
342359
# standby servers that provide sync rep.
343360
# number of sync standbys (>= 9.6) and comma-separated list of application_name from standby(s)
344361
postgresql_synchronous_standby_names: [] # '*' means 'all'
362+
postgresql_synchronized_standby_slots: "" # (>= 17) streaming replication standby server slot
345363
postgresql_synchronous_standby_num_sync: "" # >= 9.6 (NOTE: If you use the ANY/ALL syntax in v10, then note the new variable below)
346364
postgresql_synchronous_standby_choose_sync: "FIRST" # >= 10
347365
# number of xacts by which cleanup is delayed
@@ -368,6 +386,7 @@ postgresql_wal_receiver_timeout: 60s
368386
# time to wait before retrying to retrieve WAL after a failed attempt
369387
postgresql_wal_retrieve_retry_interval: 5s # (>= 9.5)
370388
postgresql_recovery_min_apply_delay: 0 # (>= 12)
389+
postgresql_sync_replication_slots: off # (>= 17) enables slot synchronization on the physical standby from the primary
371390

372391
# - Subscribers - (>= 10)
373392
# These settings are ignored on a publisher.
@@ -401,6 +420,7 @@ postgres_enable_presorted_aggregate: on # (>= 16)
401420
postgresql_enable_seqscan: on
402421
postgresql_enable_sort: on
403422
postgresql_enable_tidscan: on
423+
postgresql_enable_group_by_reordering: on
404424

405425
# - Planner Cost Constants -
406426
postgresql_seq_page_cost: 1.0 # measured on an arbitrary scale
@@ -665,6 +685,7 @@ postgresql_default_transaction_deferrable: off
665685
postgresql_session_replication_role: "origin"
666686

667687
postgresql_statement_timeout: 0 # in milliseconds, 0 is disabled
688+
postgresql_transaction_timeout: 0 # (>= 17) in milliseconds, 0 is disabled
668689
postgresql_lock_timeout: 0 # in milliseconds, 0 is disabled (>= 9.3)
669690
postgresql_idle_in_transaction_session_timeout: 0 # in milliseconds, 0 is disabled (>= 9.6)
670691
postgresql_idle_session_timeout: 0 # in milliseconds, 0 is disabled (>= 14)
@@ -680,6 +701,7 @@ postgresql_xmlbinary: "base64"
680701
postgresql_xmloption: "content"
681702
postgresql_gin_pending_list_limit: 4MB # (>= 9.5)
682703
postgresql_createrole_self_grant: '' # (>= 16) 'set', 'inherit' or 'set, inherit'
704+
postgresql_event_triggers: on # (>= 17)
683705

684706
# - Locale and Formatting -
685707

@@ -768,6 +790,7 @@ postgresql_sql_inheritance: on # (<= 9.6)
768790
# - Other Platforms and Clients -
769791

770792
postgresql_transform_null_equals: off
793+
postgresql_allow_alter_system: on # (>= 17)
771794

772795
#------------------------------------------------------------------------------
773796
# ERROR HANDLING

molecule/default/molecule.yml

+10
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ platforms:
4848
pre_build_image: true
4949
cgroupns_mode: host
5050
command: ${MOLECULE_DOCKER_COMMAND:-""}
51+
- name: postgresql-17
52+
image: "geerlingguy/docker-${MOLECULE_DISTRO:-debian11}-ansible:latest"
53+
volumes:
54+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
55+
privileged: true
56+
pre_build_image: true
57+
cgroupns_mode: host
58+
command: ${MOLECULE_DOCKER_COMMAND:-""}
5159
provisioner:
5260
name: ansible
5361
config_options:
@@ -68,5 +76,7 @@ provisioner:
6876
postgresql_version: 15
6977
postgresql-16:
7078
postgresql_version: 16
79+
postgresql-17:
80+
postgresql_version: 17
7181
verifier:
7282
name: ansible

templates/postgresql.conf-16.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ dynamic_shared_memory_type = {{ postgresql_dynamic_shared_memory_type }} # the d
159159
# mmap
160160
# (change requires restart)
161161
min_dynamic_shared_memory = {{ postgresql_min_dynamic_shared_memory }} # (change requires restart)
162-
vacuum_buffer_usage_limit = {{ postgres_vacuum_buffer_usage_limit }} # size of vacuum and analyze buffer access strategy ring;
162+
vacuum_buffer_usage_limit = {{ postgresql_vacuum_buffer_usage_limit }} # size of vacuum and analyze buffer access strategy ring;
163163
# 0 to disable vacuum buffer access strategy;
164164
# range 128kB to 16GB
165165

0 commit comments

Comments
 (0)