-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extended and adapted to install PostgreSQL 10 for CentOS and Ubuntu #267
Changes from 2 commits
93b7143
b6b12a7
430bb1e
fd9b231
5a02391
3dec063
db0e837
fec5895
59c1ccc
82140ca
9cdd7ae
61b63c5
996d471
53c7d5b
511f5b0
dec9295
7ae272f
bf33550
38b8851
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# file: postgresql/defaults/main.yml | ||
|
||
# Basic settings | ||
postgresql_version: 9.3 | ||
postgresql_version: 9.6 # if you use postgis too check whether the postgresql/postgis versions work together | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably don't need that postgis comment in there. There is a PR #310 , which will give reasonable defaults for PostGIS now. |
||
postgresql_encoding: 'UTF-8' | ||
postgresql_locale_parts: | ||
- 'en_US' # Locale | ||
|
@@ -117,6 +117,7 @@ postgresql_ssl_ciphers: | |
postgresql_ssl_prefer_server_ciphers: on | ||
postgresql_ssl_ecdh_curve: 'prime256v1' | ||
postgresql_ssl_renegotiation_limit: 512MB # amount of data between renegotiations | ||
postgresal_ssl_dh_params_file: '' # (>= 10) specify file name for custom OpenSSL DH parameters | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in parameter name |
||
postgresql_ssl_cert_file: /etc/ssl/certs/ssl-cert-snakeoil.pem # (>= 9.2) | ||
postgresql_ssl_key_file: /etc/ssl/private/ssl-cert-snakeoil.key # (>= 9.2) | ||
postgresql_ssl_ca_file: '' # (>= 9.2) | ||
|
@@ -319,6 +320,15 @@ postgresql_wal_receiver_timeout: 60s | |
# time to wait before retrying to retrieve WAL after a failed attempt | ||
postgresql_wal_retrieve_retry_interval: 5s # (>= 9.5) | ||
|
||
# - Subscribers - (>= 10) | ||
|
||
# These settings are ignored on a publisher. | ||
|
||
postgresql_max_logical_replication_workers: 4 # (>= 10) taken from max_worker_processes | ||
# (change requires restart) | ||
postgresql_max_sync_workers_per_subscription: 2 # (>= 10) taken from max_logical_replication_workers | ||
|
||
|
||
#------------------------------------------------------------------------------ | ||
# QUERY TUNING | ||
#------------------------------------------------------------------------------ | ||
|
@@ -347,7 +357,9 @@ postgresql_cpu_index_tuple_cost: 0.005 # same scale as above | |
postgresql_cpu_operator_cost: 0.0025 # same scale as above | ||
postgresql_parallel_tuple_cost: 0.1 # same scale as above (>= 9.6) | ||
postgresql_parallel_setup_cost: 1000.0 # same scale as above (>= 9.6) | ||
postgresql_min_parallel_relation_size: 8MB # (>= 9.6) | ||
postgresql_min_parallel_relation_size: 8MB # (== 9.6) | ||
postgresql_min_parallel_table_scan_size: 8MB # (>= 10) | ||
postgresql_min_parallel_index_scan_size: 512kB # (>= 10) | ||
postgresql_effective_cache_size: 128MB | ||
|
||
|
||
|
@@ -499,11 +511,13 @@ postgresql_log_line_prefix: '%t ' | |
# log lock waits >= deadlock_timeout | ||
postgresql_log_lock_waits: off | ||
postgresql_log_statement: none # none, ddl, mod, all | ||
postgresql_log_replication_commands: off # (>= 10) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was introduced in v9.5, not v10: https://www.postgresql.org/docs/9.5/static/runtime-config-logging.html#GUC-LOG-REPLICATION-COMMANDS I've added #314 to backport this |
||
# log temporary files equal or larger | ||
postgresql_log_temp_files: -1 | ||
postgresql_log_timezone: UTC | ||
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the 3rd blank line? |
||
#------------------------------------------------------------------------------ | ||
# RUNTIME STATISTICS | ||
#------------------------------------------------------------------------------ | ||
|
@@ -587,7 +601,8 @@ postgresql_vacuum_multixact_freeze_table_age: 150000000 # (>= 9.3) | |
postgresql_bytea_output: hex # hex, escape | ||
postgresql_xmlbinary: base64 | ||
postgresql_xmloption: content | ||
postgresql_gin_fuzzy_search_limit: 0 # (<= 9.2) | ||
postgresql_gin_fuzzy_search_limit: 0 # (<= 9.2, >=10) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This parameter has been around at least since 9.0... and still exists in 10. We should remove the entire comment about version ranges. https://www.postgresql.org/docs/10/static/runtime-config-client.html |
||
postgresql_gin_pending_list_limit: 4MB # (>= 10) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was added in v9.5, not in v10. I've added that to #314 too. |
||
|
||
|
||
# - Locale and Formatting - | ||
|
@@ -639,6 +654,11 @@ postgresql_max_locks_per_transaction: 64 # min 10 | |
# lock table slots. | ||
postgresql_max_pred_locks_per_transaction: 64 # min 10 | ||
|
||
postgresql_max_pred_locks_per_relation: -2 # (>= 10) negative values mean | ||
# (max_pred_locks_per_transaction | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need these comments in this file? If someone wants to know what it does, then they can check the doco, or the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. Same for other comments taken from the original config file. May be for less exerienced people like me helpful to read it here too :-). |
||
# / -max_pred_locks_per_relation) - 1 | ||
postgresql_max_pred_locks_per_page: 2 # (>= 10) min 0 | ||
|
||
|
||
#------------------------------------------------------------------------------ | ||
# VERSION/PLATFORM COMPATIBILITY | ||
|
@@ -713,6 +733,7 @@ postgresql_pgdg_releases: | |
9.4: 3, | ||
9.5: 3, | ||
9.6: 3, | ||
10: 2, | ||
} | ||
centos: { | ||
9.1: 7, | ||
|
@@ -721,6 +742,7 @@ postgresql_pgdg_releases: | |
9.4: 3, | ||
9.5: 3, | ||
9.6: 3, | ||
10: 2, | ||
} | ||
sl: { | ||
9.1: 8, | ||
|
@@ -729,6 +751,7 @@ postgresql_pgdg_releases: | |
9.4: 3, | ||
9.5: 3, | ||
9.6: 3, | ||
10: 2, | ||
} | ||
oraclelinux: { | ||
9.1: 8, | ||
|
@@ -737,6 +760,7 @@ postgresql_pgdg_releases: | |
9.4: 3, | ||
9.5: 3, | ||
9.6: 3, | ||
10: 2, | ||
} | ||
postgresql_version_terse: "{{ postgresql_version | replace('.', '') }}" | ||
postgresql_yum_repository_base_url: "http://yum.postgresql.org" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# file: postgresql/tasks/extensions.yml | ||
|
||
- include: extensions/contrib.yml | ||
- include_tasks: extensions/contrib.yml | ||
when: postgresql_ext_install_contrib | ||
- include: extensions/dev_headers.yml | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Superseded by #293... but adding the spaces is probably a good idea. |
||
- include_tasks: extensions/dev_headers.yml | ||
when: postgresql_ext_install_dev_headers | ||
- include: extensions/postgis.yml | ||
|
||
- include_tasks: extensions/postgis.yml | ||
when: postgresql_ext_install_postgis |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,13 @@ | |
How to add a new PostgreSQL version | ||
=================================== | ||
|
||
1) Download the Debian package 'postgresql-9.X_[...].deb' from | ||
1) Download the Debian package 'postgresql-<version>_[...].deb' from | ||
http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.X/ | ||
|
||
2) Extract the 'usr/share/postgresql/9.1/postgresql.conf.sample' file | ||
and save it under the 'templates' role directory | ||
2) Extract the 'usr/share/postgresql/9.1/postgresql.conf.sample' file with | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update to v10 here too, not v9.1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
dpkg-deb -x postgresql-<version>_[...].deb dir/to/extract/to/ | ||
|
||
and save it under the 'templates' role directory | ||
=> templates/postgresql.conf.9.{X}.orig | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
||
3) Check the difference between another version: | ||
|
@@ -19,4 +21,6 @@ and save it under the 'templates' role directory | |
|
||
5) If there are new options or some of them removed, update the 'default/main.yml' file and add a "(>= 9.X)" or "(<= 9.X)" comment to them. | ||
|
||
6) Update the '.travis.yml' file to test its new version. | ||
7) For yum based installation add version and minor version of postgresql in 'default/main.yml' under '# YUM settings' at end of file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You skipped the point 6) (5 to 7) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Sébastien, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that @sebalix was saying that in the file, there is now no step 6
|
||
|
||
8) Update the '.travis.yml' file to test its new version. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,8 @@ Group={{ postgresql_service_group }} | |
Environment=PGDATA={{ postgresql_conf_directory }} | ||
|
||
ExecStartPre= | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why leave this blank line here... it's a historical typo, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blank line deleted. |
||
{% if postgresql_version == 10 %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this point I'd say There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for re-reviewing... but we should be using the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done ;-) |
||
ExecStartPre={{ postgresql_bin_directory }}/postgresql-{{ postgresql_version_terse }}-check-db-dir {{ postgresql_data_directory }} | ||
{% else %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the indentation on this correct? Should it be better written in this format, ans using the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation removed. version_compare() filter used to check the version. |
||
ExecStartPre={{ postgresql_bin_directory }}/postgresql{{ postgresql_version_terse }}-check-db-dir {{ postgresql_data_directory }} | ||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this related to the PostgreSQL v10 update? It looks interesting, but isn't related to this Pull Request, right?