Skip to content

Commit 0ed39ed

Browse files
authored
Merge pull request ANXS#212 from MichaelConrad/implement_postgresql_9_6
Add compatibility for PostgreSQL 9.6
2 parents 4b50832 + 7e5dd5f commit 0ed39ed

File tree

5 files changed

+1408
-75
lines changed

5 files changed

+1408
-75
lines changed

.travis.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ env:
1414
- ROLE_OPTIONS="postgresql_version=9.3" ANSIBLE_VERSION="1.9.4"
1515
- ROLE_OPTIONS="postgresql_version=9.4" ANSIBLE_VERSION="1.9.4"
1616
- ROLE_OPTIONS="postgresql_version=9.5" ANSIBLE_VERSION="1.9.4"
17-
- ROLE_OPTIONS="postgresql_version=9.1" ANSIBLE_VERSION="2.0.0.2"
18-
- ROLE_OPTIONS="postgresql_version=9.2" ANSIBLE_VERSION="2.0.0.2"
19-
- ROLE_OPTIONS="postgresql_version=9.3" ANSIBLE_VERSION="2.0.0.2"
20-
- ROLE_OPTIONS="postgresql_version=9.4" ANSIBLE_VERSION="2.0.0.2"
21-
- ROLE_OPTIONS="postgresql_version=9.5" ANSIBLE_VERSION="2.0.0.2"
17+
- ROLE_OPTIONS="postgresql_version=9.6" ANSIBLE_VERSION="1.9.4"
18+
- ROLE_OPTIONS="postgresql_version=9.1" ANSIBLE_VERSION="2.1.2.0"
19+
- ROLE_OPTIONS="postgresql_version=9.2" ANSIBLE_VERSION="2.1.2.0"
20+
- ROLE_OPTIONS="postgresql_version=9.3" ANSIBLE_VERSION="2.1.2.0"
21+
- ROLE_OPTIONS="postgresql_version=9.4" ANSIBLE_VERSION="2.1.2.0"
22+
- ROLE_OPTIONS="postgresql_version=9.5" ANSIBLE_VERSION="2.1.2.0"
23+
- ROLE_OPTIONS="postgresql_version=9.6" ANSIBLE_VERSION="2.1.2.0"
2224

2325
before_install:
2426
# Remove the PostgreSQL installed by Travis
@@ -50,4 +52,4 @@ script:
5052

5153
# Testing with docker (experimental)
5254
- docker build -f tests/Dockerfile-ubuntu14.04 -t postgres_ubuntu14.04 .
53-
- docker build -f tests/Dockerfile-centos6 -t postgres_centos6 .
55+
- docker build -f tests/Dockerfile-centos6 -t postgres_centos6 .

defaults/main.yml

Lines changed: 121 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,15 @@ postgresql_shared_buffers: 128MB # min 128kB
141141
postgresql_huge_pages: try # on, off, or try
142142
postgresql_temp_buffers: 8MB # min 800kB
143143

144-
# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
145-
# per transaction slot, plus lock space (see max_locks_per_transaction).
146-
# It is not advisable to set max_prepared_transactions nonzero unless you
147-
# actively intend to use prepared transactions.
144+
# Caution: it is not advisable to set max_prepared_transactions nonzero unless
145+
# you actively intend to use prepared transactions.
148146
postgresql_max_prepared_transactions: 0 # zero disables the feature
149147

150-
postgresql_work_mem: 1MB # min 64kB
151-
postgresql_maintenance_work_mem: 16MB # min 1MB
152-
postgresql_autovacuum_work_mem: -1 # min 1MB, or -1 to use maintenance_work_mem
153-
postgresql_max_stack_depth: 2MB # min 100kB
148+
postgresql_work_mem: 1MB # min 64kB
149+
postgresql_maintenance_work_mem: 16MB # min 1MB
150+
postgresql_replacement_sort_tuples: 150000 # (>= 9.6) limits use of replacement selection sort
151+
postgresql_autovacuum_work_mem: -1 # min 1MB, or -1 to use maintenance_work_mem
152+
postgresql_max_stack_depth: 2MB # min 100kB
154153
postgresql_dynamic_shared_memory_type: posix # the default is the first option
155154
# supported by the operating system:
156155
# posix
@@ -162,7 +161,7 @@ postgresql_dynamic_shared_memory_type: posix # the default is the first optio
162161

163162
# - Disk -
164163

165-
# limits per-session temp file space in kB, or -1 for no limit (>= 9.2)
164+
# limits per-process temp file space in kB, or -1 for no limit (>= 9.2)
166165
postgresql_temp_file_limit: -1
167166

168167

@@ -185,13 +184,19 @@ postgresql_vacuum_cost_limit: 200 # 1-10000 credits
185184

186185
postgresql_bgwriter_delay: 200ms # 10-10000ms between rounds
187186
postgresql_bgwriter_lru_maxpages: 100 # 0-1000 max buffers written/round
188-
postgresql_bgwriter_lru_multiplier: 2.0 # 0-10.0 multipler on buffers scanned/round
187+
postgresql_bgwriter_lru_multiplier: 2.0 # 0-10.0 multiplier on buffers scanned/round
188+
postgresql_bgwriter_flush_after: 0 # (>= 9.6) 0 disables,
189+
# default is 512kB on linux, 0 otherwise
189190

190191

191192
# - Asynchronous Behavior -
192193

193-
postgresql_effective_io_concurrency: 1 # 1-1000; 0 disables prefetching
194-
postgresql_max_worker_processes: 8
194+
postgresql_effective_io_concurrency: 1 # 1-1000; 0 disables prefetching
195+
postgresql_max_worker_processes: 8 # (change requires restart)
196+
postgresql_max_parallel_workers_per_gather: 0 # (>= 9.6) taken from max_worker_processes
197+
postgresql_old_snapshot_threshold: -1 # (>= 9.6) 1min-60d; -1 disables; 0 is immediate
198+
# (change requires restart)
199+
postgresql_backend_flush_after: 0 # (>= 9.6) 0 disables, default is 0
195200

196201

197202
#------------------------------------------------------------------------------
@@ -200,13 +205,16 @@ postgresql_max_worker_processes: 8
200205

201206
# - Settings -
202207

203-
postgresql_wal_level: minimal # minimal, archive, hot_standby, or logical
204-
postgresql_fsync: on # turns forced synchronization on or off
208+
postgresql_wal_level: minimal # minimal, archive (<= 9.5), hot_standby (<= 9.5), replica (>= 9.6), or logical
209+
postgresql_fsync: on # flush data to disk for crash safety
210+
# (turning this off can cause
211+
# unrecoverable data corruption)
205212

206213
# Synchronization level:
207214
# - off
208215
# - local
209216
# - remote_write
217+
# - remote_apply (>= 9.6)
210218
# - on
211219
postgresql_synchronous_commit: "on"
212220

@@ -223,18 +231,21 @@ postgresql_full_page_writes: on
223231
postgresql_wal_compression: off # (>= 9.5)
224232
postgresql_wal_log_hints: off # also do full page writes of non-critical updates
225233

226-
postgresql_wal_buffers: -1 # min 32kB, -1 sets based on shared_buffers
227-
postgresql_wal_writer_delay: 200ms # 1-10000 milliseconds
228-
postgresql_commit_delay: 0 # range 0-100000, in microseconds
229-
postgresql_commit_siblings: 5 # range 1-1000
234+
postgresql_wal_buffers: -1 # min 32kB, -1 sets based on shared_buffers
235+
postgresql_wal_writer_delay: 200ms # 1-10000 milliseconds
236+
postgresql_wal_writer_flush_after: 1MB # (>= 9.6) 0 disables
237+
postgresql_commit_delay: 0 # range 0-100000, in microseconds
238+
postgresql_commit_siblings: 5 # range 1-1000
230239

231240

232241
# - Checkpoints -
233242

234243
postgresql_checkpoint_segments: 3 # (<= 9.4) in logfile segments, min 1, 16MB each
235244
postgresql_max_wal_size: 1GB # (>= 9.5)
236245
postgresql_min_wal_size: 80MB # (>= 9.5)
237-
postgresql_checkpoint_timeout: 5min # range 30s-1h
246+
postgresql_checkpoint_flush_after: 0 # (>= 9.6) 0 disables,
247+
# default is 256kB on linux, 0 otherwise
248+
postgresql_checkpoint_timeout: 5min # range 30s-1d
238249
postgresql_checkpoint_completion_target: 0.5 # checkpoint target duration, 0.0 - 1.0
239250
postgresql_checkpoint_warning: 30s # 0 disables
240251

@@ -277,8 +288,9 @@ postgresql_track_commit_timestamp: off # (>= 9.5)
277288

278289
# These settings are ignored on a standby server.
279290

280-
# Standby servers that provide sync rep.
281-
# Comma-separated list of application_name from standby(s)
291+
# standby servers that provide sync rep.
292+
# number of sync standbys (>= 9.6) and comma-separated list of application_name from standby(s)
293+
postgresql_synchronous_standby_num_sync: ''
282294
postgresql_synchronous_standby_names: [] # '*' means 'all'
283295

284296
# number of xacts by which cleanup is delayed
@@ -308,47 +320,51 @@ postgresql_wal_retrieve_retry_interval: 5s # (>= 9.5)
308320

309321
# - Planner Method Configuration -
310322

311-
postgresql_enable_bitmapscan: on
312-
postgresql_enable_hashagg: on
313-
postgresql_enable_hashjoin: on
314-
postgresql_enable_indexscan: on
315-
postgresql_enable_indexonlyscan: on
316-
postgresql_enable_material: on
317-
postgresql_enable_mergejoin: on
318-
postgresql_enable_nestloop: on
319-
postgresql_enable_seqscan: on
320-
postgresql_enable_sort: on
321-
postgresql_enable_tidscan: on
323+
postgresql_enable_bitmapscan: on
324+
postgresql_enable_hashagg: on
325+
postgresql_enable_hashjoin: on
326+
postgresql_enable_indexscan: on
327+
postgresql_enable_indexonlyscan: on
328+
postgresql_enable_material: on
329+
postgresql_enable_mergejoin: on
330+
postgresql_enable_nestloop: on
331+
postgresql_enable_seqscan: on
332+
postgresql_enable_sort: on
333+
postgresql_enable_tidscan: on
322334

323335

324336
# - Planner Cost Constants -
325337

326-
postgresql_seq_page_cost: 1.0 # measured on an arbitrary scale
327-
postgresql_random_page_cost: 4.0 # same scale as above
328-
postgresql_cpu_tuple_cost: 0.01 # same scale as above
329-
postgresql_cpu_index_tuple_cost: 0.005 # same scale as above
330-
postgresql_cpu_operator_cost: 0.0025 # same scale as above
331-
postgresql_effective_cache_size: 128MB
338+
postgresql_seq_page_cost: 1.0 # measured on an arbitrary scale
339+
postgresql_random_page_cost: 4.0 # same scale as above
340+
postgresql_cpu_tuple_cost: 0.01 # same scale as above
341+
postgresql_cpu_index_tuple_cost: 0.005 # same scale as above
342+
postgresql_cpu_operator_cost: 0.0025 # same scale as above
343+
postgresql_parallel_tuple_cost: 0.1 # same scale as above (>= 9.6)
344+
postgresql_parallel_setup_cost: 1000.0 # same scale as above (>= 9.6)
345+
postgresql_min_parallel_relation_size: 8MB # (>= 9.6)
346+
postgresql_effective_cache_size: 128MB
332347

333348

334349
# - Genetic Query Optimizer -
335350

336-
postgresql_geqo: on
337-
postgresql_geqo_threshold: 12
338-
postgresql_geqo_effort: 5 # range 1-10
339-
postgresql_geqo_pool_size: 0 # selects default based on effort
340-
postgresql_geqo_generations: 0 # selects default based on effort
341-
postgresql_geqo_selection_bias: 2.0 # range 1.5-2.0
342-
postgresql_geqo_seed: 0.0 # range 0.0-1.0
351+
postgresql_geqo: on
352+
postgresql_geqo_threshold: 12
353+
postgresql_geqo_effort: 5 # range 1-10
354+
postgresql_geqo_pool_size: 0 # selects default based on effort
355+
postgresql_geqo_generations: 0 # selects default based on effort
356+
postgresql_geqo_selection_bias: 2.0 # range 1.5-2.0
357+
postgresql_geqo_seed: 0.0 # range 0.0-1.0
343358

344359

345360
# - Other Planner Options -
346361

347-
postgresql_default_statistics_target: 100 # range 1-10000
348-
postgresql_constraint_exclusion: partition # on, off, or partition
349-
postgresql_cursor_tuple_fraction: 0.1 # range 0.0-1.0
350-
postgresql_from_collapse_limit: 8
351-
postgresql_join_collapse_limit: 8 # 1 disables collapsing of explicit
362+
postgresql_default_statistics_target: 100 # range 1-10000
363+
postgresql_constraint_exclusion: partition # on, off, or partition
364+
postgresql_cursor_tuple_fraction: 0.1 # range 0.0-1.0
365+
postgresql_from_collapse_limit: 8
366+
postgresql_join_collapse_limit: 8 # 1 disables collapsing of explicit
367+
postgresql_force_parallel_mode: off # (>= 9.6)
352368

353369

354370
#------------------------------------------------------------------------------
@@ -359,34 +375,36 @@ postgresql_join_collapse_limit: 8 # 1 disables collapsing of expl
359375

360376
# Valid values are combinations of stderr, csvlog, syslog, and eventlog.
361377
# depending on platform. Csvlog requires logging_collector to be on.
362-
postgresql_log_destination: stderr
378+
postgresql_log_destination: stderr
363379

364380
# Enable capturing of stderr and csvlog into log files.
365381
# Required to be on for csvlogs.
366-
postgresql_logging_collector: off
382+
postgresql_logging_collector: off
367383

368384
# These are only used if logging_collector is on:
369385

370386
# Directory where log files are written, can be absolute or relative to PGDATA
371-
postgresql_log_directory: pg_log
387+
postgresql_log_directory: pg_log
372388
# Log file name pattern, can include strftime() escapes
373-
postgresql_log_filename: postgresql-%Y-%m-%d_%H%M%S.log
374-
postgresql_log_file_mode: '0600' # begin with 0 to use octal notation
389+
postgresql_log_filename: postgresql-%Y-%m-%d_%H%M%S.log
390+
postgresql_log_file_mode: '0600' # begin with 0 to use octal notation
375391
# If on, an existing log file with the same name as the new log file will be
376392
# truncated rather than appended to. But such truncation only occurs on
377393
# time-driven rotation, not on restarts or size-driven rotation. Default is
378394
# off, meaning append to existing files in all cases.
379-
postgresql_log_truncate_on_rotation: off
395+
postgresql_log_truncate_on_rotation: off
380396
# Automatic rotation of logfiles will happen after that time.
381-
postgresql_log_rotation_age: 1d
397+
postgresql_log_rotation_age: 1d
382398
# Automatic rotation of logfiles will happen after that much log output.
383-
postgresql_log_rotation_size: 10MB
399+
postgresql_log_rotation_size: 10MB
384400

385401
# These are relevant when logging to syslog:
386-
postgresql_syslog_facility: LOCAL0
387-
postgresql_syslog_ident: postgres
402+
postgresql_syslog_facility: LOCAL0
403+
postgresql_syslog_ident: postgres
404+
postgresql_syslog_sequence_numbers: on # (>= 9.6)
405+
postgresql_syslog_split_messages: on # (>= 9.6)
388406
# This is only relevant when logging to eventlog (win32) (>= 9.2):
389-
postgresql_event_source: PostgreSQL
407+
postgresql_event_source: PostgreSQL
390408

391409

392410
# - When to Log -
@@ -460,6 +478,7 @@ postgresql_log_hostname: off
460478
# %p = process ID
461479
# %t = timestamp without milliseconds
462480
# %m = timestamp with milliseconds
481+
# %n = timestamp with milliseconds (as a Unix epoch)
463482
# %i = command tag
464483
# %e = SQL state
465484
# %c = session ID
@@ -552,12 +571,13 @@ postgresql_default_transaction_read_only: off
552571
postgresql_default_transaction_deferrable: off
553572
postgresql_session_replication_role: origin
554573

555-
postgresql_statement_timeout: 0 # in milliseconds, 0 is disabled
556-
postgresql_lock_timeout: 0 # in milliseconds, 0 is disabled (>= 9.3)
557-
postgresql_vacuum_freeze_min_age: 50000000
558-
postgresql_vacuum_freeze_table_age: 150000000
559-
postgresql_vacuum_multixact_freeze_min_age: 5000000 # (>= 9.3)
560-
postgresql_vacuum_multixact_freeze_table_age: 150000000 # (>= 9.3)
574+
postgresql_statement_timeout: 0 # in milliseconds, 0 is disabled
575+
postgresql_lock_timeout: 0 # in milliseconds, 0 is disabled (>= 9.3)
576+
postgresql_idle_in_transaction_session_timeout: 0 # in milliseconds, 0 is disabled (>= 9.6)
577+
postgresql_vacuum_freeze_min_age: 50000000
578+
postgresql_vacuum_freeze_table_age: 150000000
579+
postgresql_vacuum_multixact_freeze_min_age: 5000000 # (>= 9.3)
580+
postgresql_vacuum_multixact_freeze_table_age: 150000000 # (>= 9.3)
561581

562582
postgresql_bytea_output: hex # hex, escape
563583
postgresql_xmlbinary: base64
@@ -680,6 +700,39 @@ postgresql_pgdg_dists:
680700
Scientific: sl
681701
SLC: sl
682702
OracleLinux: oraclelinux
703+
postgresql_pgdg_releases:
704+
redhat: {
705+
9.1: 8,
706+
9.2: 9,
707+
9.3: 3,
708+
9.4: 3,
709+
9.5: 3,
710+
9.6: 3,
711+
}
712+
centos: {
713+
9.1: 7,
714+
9.2: 8,
715+
9.3: 3,
716+
9.4: 3,
717+
9.5: 3,
718+
9.6: 3,
719+
}
720+
sl: {
721+
9.1: 8,
722+
9.2: 9,
723+
9.3: 3,
724+
9.4: 3,
725+
9.5: 3,
726+
9.6: 3,
727+
}
728+
oraclelinux: {
729+
9.1: 8,
730+
9.2: 9,
731+
9.3: 3,
732+
9.4: 3,
733+
9.5: 3,
734+
9.6: 3,
735+
}
683736
postgresql_version_terse: "{{ postgresql_version | replace('.', '') }}"
684737
postgresql_yum_repository_base_url: "http://yum.postgresql.org"
685-
postgresql_yum_repository_url: "{{ postgresql_yum_repository_base_url }}/{{ postgresql_version }}/{{ ansible_os_family | lower }}/rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}/pgdg-{{ postgresql_pgdg_dists[ansible_distribution] }}{{ postgresql_version_terse }}-{{ postgresql_version }}-2.noarch.rpm"
738+
postgresql_yum_repository_url: "{{ postgresql_yum_repository_base_url }}/{{ postgresql_version }}/{{ ansible_os_family | lower }}/rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}/pgdg-{{ postgresql_pgdg_dists[ansible_distribution] }}{{ postgresql_version_terse }}-{{ postgresql_version }}-{{ postgresql_pgdg_releases.get(postgresql_pgdg_dists[ansible_distribution]).get(postgresql_version) }}.noarch.rpm"

0 commit comments

Comments
 (0)