├── tests └── ansible.inventory ├── roles ├── postgresql │ ├── tasks │ │ ├── main.yml │ │ ├── repository.yml │ │ └── postgresql.yml │ ├── handlers │ │ └── main.yml │ ├── files │ │ └── ACCC4CF8.asc │ └── templates │ │ └── postgresql.conf └── pgbouncer │ ├── handlers │ └── main.yml │ ├── tasks │ └── main.yml │ └── templates │ └── pgbouncer.ini.j2 ├── setup.yml ├── .travis.yml ├── group_vars └── all ├── README.md └── LICENSE.txt /tests/ansible.inventory: -------------------------------------------------------------------------------- 1 | [all] 2 | 127.0.0.1 3 | -------------------------------------------------------------------------------- /roles/postgresql/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: repository.yml 4 | - include: postgresql.yml 5 | -------------------------------------------------------------------------------- /roles/pgbouncer/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart pgbouncer 3 | service: name=pgbouncer state=restarted 4 | -------------------------------------------------------------------------------- /roles/postgresql/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart postgresql 3 | service: name=postgresql state=restarted 4 | -------------------------------------------------------------------------------- /setup.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: 'PostgreSQL Playbook' 3 | hosts: postgresql_nodes 4 | user: root 5 | 6 | roles: 7 | - postgresql 8 | - pgbouncer 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | python: 4 | - "2.7" 5 | 6 | install: 7 | - pip install ansible 8 | 9 | script: 10 | - find . -name '*.yml' -not -path './.travis.yml' -not -path './roles/*/files/*' | xargs -t -n1 ansible-playbook --syntax-check -i tests/ansible.inventory 11 | 12 | notifications: 13 | email: 14 | - tomaz+travisci@tomaz.me 15 | -------------------------------------------------------------------------------- /roles/postgresql/tasks/repository.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Needed for add-apt-repository 3 | - name: Install python-software-properties 4 | apt: pkg=python-software-properties state=installed update-cache=yes 5 | tags: 6 | - apt 7 | 8 | - name: Add repository key 9 | apt_key: data="{{ lookup('file', 'ACCC4CF8.asc') }}" state=present 10 | tags: 11 | - apt 12 | 13 | - name: Add PostgreSQL repository 14 | apt_repository: repo='{{ postgresql.repo }}' state=present 15 | tags: 16 | - apt 17 | -------------------------------------------------------------------------------- /roles/pgbouncer/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install pgbouncer 3 | apt: pkg=pgbouncer state=installed update-cache=yes 4 | 5 | - name: Install pgbouncer config 6 | action: template src=pgbouncer.ini.j2 dest=/etc/pgbouncer/pgbouncer.ini 7 | mode=0600 owner={{ pgbouncer.user }} group={{ pgbouncer.group }} 8 | notify: 9 | - restart pgbouncer 10 | 11 | - name: Enable pgbouncer 12 | lineinfile: dest=/etc/default/pgbouncer regexp=^START=0$ line=START=1 13 | notify: 14 | - restart pgbouncer 15 | -------------------------------------------------------------------------------- /group_vars/all: -------------------------------------------------------------------------------- 1 | postgresql: 2 | version: 9.2 3 | repo: 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' 4 | install_development_headers: true 5 | 6 | user: postgres 7 | group: postgres 8 | 9 | config: 10 | shared_buffers: 24MB 11 | work_mem: 1MB 12 | 13 | checkpoint_segments: 3 14 | checkpoint_completion_target: 0.5 15 | 16 | effective_cache_size: 128MB 17 | 18 | pgbouncer: 19 | user: postgres 20 | group: postgres 21 | 22 | config: 23 | database_host: 127.0.0.1 24 | database_port: 5432 25 | 26 | listen_addr: 127.0.0.1 27 | listen_port: 6432 28 | 29 | user: postgres 30 | 31 | auth_type: md5 32 | auth_file: /etc/pgbouncer/userlist.txt 33 | -------------------------------------------------------------------------------- /roles/postgresql/tasks/postgresql.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Postgresql server and client 3 | apt: pkg={{ item }}-{{ postgresql.version }} state=installed update-cache=yes 4 | register: postgresql_install 5 | with_items: 6 | - postgresql 7 | tags: 8 | - packages 9 | 10 | - name: Install development header files 11 | apt: pkg={{ item }} state=installed update-cache=yes 12 | when: postgresql.install_development_headers == true 13 | with_items: 14 | - libpq-dev 15 | tags: 16 | - packages 17 | 18 | - name: Install PostgreSQL config file 19 | template: src=postgresql.conf 20 | dest=/etc/postgresql/{{ postgresql.version }}/main/postgresql.conf 21 | owner={{ postgresql.user }} group={{ postgresql.group }} 22 | notify: 23 | - restart postgresql 24 | tags: 25 | - configuration 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ansible PostgreSQL playbook 2 | 3 | This is an Ansible playbook for deploying PostgreSQL 9.1, 9.2 or 9.3. 4 | 5 | This playbook was tested on Ubuntu 12.04 x86_64. 6 | 7 | ## Features 8 | 9 | * Install PostgreSQL 10 | * Install development headers (optional) 11 | * Install pgbouncer (optional) 12 | 13 | ## Notes 14 | 15 | * pgbouncer uses md5 authentication but doesn't install a userlist.txt file 16 | (you need to do this as part of your other playbook) 17 | 18 | ## Requirements 19 | 20 | This playbook requires Ansible 1.2 or higher. 21 | 22 | ## group_vars 23 | 24 | Variables which can be configured are located in the `group_vars/all` file. 25 | 26 | Supported PostgreSQL versions: 27 | 28 | * `9.1` 29 | * `9.2` 30 | * `9.3` 31 | 32 | ## Running playbook 33 | 34 | ```bash 35 | ansible-playbook -i ansible.host setup.yml 36 | ``` 37 | 38 | ## License 39 | 40 | This playbook is distributed under the 41 | [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html). 42 | -------------------------------------------------------------------------------- /roles/postgresql/files/ACCC4CF8.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v1.4.12 (GNU/Linux) 3 | 4 | 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 40 | VPZ67j5UMxqtT/Y4+NHcQGgwF/1i 41 | =Iugu 42 | -----END PGP PUBLIC KEY BLOCK----- 43 | -------------------------------------------------------------------------------- /roles/pgbouncer/templates/pgbouncer.ini.j2: -------------------------------------------------------------------------------- 1 | ;; database name = connect string 2 | ;; 3 | ;; connect string params: 4 | ;; dbname= host= port= user= password= 5 | ;; client_encoding= datestyle= timezone= 6 | ;; pool_size= connect_query= 7 | 8 | [databases] 9 | * = host={{ pgbouncer.config.database_host }} port={{ pgbouncer.config.database_port }} 10 | 11 | ;; Configuation section 12 | [pgbouncer] 13 | user = {{ pgbouncer.config.user }} 14 | 15 | ;;; 16 | ;;; Administrative settings 17 | ;;; 18 | 19 | logfile = /var/log/postgresql/pgbouncer.log 20 | pidfile = /var/run/postgresql/pgbouncer.pid 21 | 22 | ;;; 23 | ;;; Where to wait for clients 24 | ;;; 25 | 26 | ; ip address or * which means all ip-s 27 | listen_addr = {{ pgbouncer.config.listen_addr }} 28 | listen_port = {{ pgbouncer.config.listen_port }} 29 | 30 | ; unix socket is also used for -R. 31 | ; On debian it should be /var/run/postgresql 32 | unix_socket_dir = /var/run/postgresql 33 | 34 | ;;; 35 | ;;; Authentication settings 36 | ;;; 37 | 38 | ; any, trust, plain, crypt, md5 39 | auth_type = {{ pgbouncer.config.auth_type }} 40 | auth_file = {{ pgbouncer.config.auth_file }} 41 | 42 | ;;; 43 | ;;; Users allowed into database 'pgbouncer' 44 | ;;; 45 | 46 | ; comma-separated list of users, who are allowed to change settings 47 | admin_users = 48 | 49 | ; comma-separated list of users who are just allowed to use SHOW command 50 | stats_users = 51 | 52 | ;;; 53 | ;;; Pooler personality questions 54 | ;;; 55 | 56 | ; When server connection is released back to pool: 57 | ; session - after client disconnects 58 | ; transaction - after transaction finishes 59 | ; statement - after statement finishes 60 | pool_mode = session 61 | 62 | ; Query for cleaning connection immidiately after releasing from client. 63 | ; No need to put ROLLBACK here, pgbouncer does not reuse connections 64 | ; where transaction is left open. 65 | ; 66 | ; Query for 8.3+: 67 | ; DISCARD ALL; 68 | ; 69 | ; Older versions: 70 | ; RESET ALL; SET SESSION AUTHORIZATION DEFAULT 71 | ; 72 | ; Empty if transaction pooling is in use. 73 | ; 74 | server_reset_query = DISCARD ALL 75 | 76 | ; 77 | ; Comma-separated list of parameters to ignore when given 78 | ; in startup packet. Newer JDBC versions require the 79 | ; extra_float_digits here. 80 | ; 81 | ;ignore_startup_parameters = extra_float_digits 82 | 83 | ; 84 | ; When taking idle server into use, this query is ran first. 85 | ; SELECT 1 86 | ; 87 | server_check_query = select 1 88 | 89 | ; If server was used more recently that this many seconds ago, 90 | ; skip the check query. Value 0 may or may not run in immidiately. 91 | ; 30 92 | server_check_delay = 10 93 | 94 | ;;; 95 | ;;; Connection limits 96 | ;;; 97 | 98 | ; total number of clients that can connect 99 | max_client_conn = 200 100 | 101 | ; defalt pool size. 20 is good number when transaction pooling 102 | ; is in use, in session pooling it needs to be the number of 103 | ; max clients you want to handle at any moment 104 | default_pool_size = 100 105 | 106 | ; how many additional connection to allow in case of trouble 107 | ;reserve_pool_size = 5 108 | 109 | ; if a clients needs to wait more than this many seconds, use reserve pool 110 | ;reserve_pool_timeout = 3 111 | 112 | ; log if client connects or server connection is made 113 | log_connections = 1 114 | 115 | ; log if and why connection was closed 116 | log_disconnections = 1 117 | 118 | ; log error messages pooler sends to clients 119 | ;log_pooler_errors = 1 120 | 121 | 122 | ; If off, then server connections are reused in LIFO manner 123 | ;server_round_robin = 0 124 | 125 | ;;; 126 | ;;; Timeouts 127 | ;;; 128 | 129 | ;; Close server connection if its been connected longer. 130 | ;server_lifetime = 1200 131 | 132 | ;; Close server connection if its not been used in this time. 133 | ;; Allows to clean unneccessary connections from pool after peak. 134 | ;server_idle_timeout = 60 135 | 136 | ;; Cancel connection attepmt if server does not answer takes longer. 137 | ;server_connect_timeout = 15 138 | 139 | ;; If server login failed (server_connect_timeout or auth failure) 140 | ;; then wait this many second. 141 | ;server_login_retry = 15 142 | 143 | ;; Dangerous. Server connection is closed if query does not return 144 | ;; in this time. Should be used to survive network problems, 145 | ;; _not_ as statement_timeout. (default: 0) 146 | ;query_timeout = 0 147 | 148 | ;; Dangerous. Client connection is closed if the query is not assigned 149 | ;; to a server in this time. Should be used to limit the number of queued 150 | ;; queries in case of a database or network failure. (default: 0) 151 | ;query_wait_timeout = 0 152 | 153 | ;; Dangerous. Client connection is closed if no activity in this time. 154 | ;; Should be used to survive network problems. (default: 0) 155 | ;client_idle_timeout = 0 156 | 157 | ;; Disconnect clients who have not managed to log in after connecting 158 | ;; in this many seconds. 159 | ;client_login_timeout = 60 160 | 161 | ;; Clean automatically created database entries (via "*") if they 162 | ;; stay unused in this many seconds. 163 | ; autodb_idle_timeout = 3600 164 | 165 | ;;; 166 | ;;; Low-level tuning options 167 | ;;; 168 | 169 | ;; buffer for streaming packets 170 | ;pkt_buf = 2048 171 | 172 | ;; man 2 listen 173 | ;listen_backlog = 128 174 | 175 | ;; networking options, for info: man 7 tcp 176 | 177 | ;; linux: notify program about new connection only if there 178 | ;; is also data received. (Seconds to wait.) 179 | ;; On Linux the default is 45, on other OS'es 0. 180 | ;tcp_defer_accept = 0 181 | 182 | ;; In-kernel buffer size (linux default: 4096) 183 | ;tcp_socket_buffer = 0 184 | 185 | ;; whether tcp keepalive should be turned on (0/1) 186 | ;tcp_keepalive = 1 187 | 188 | ;; following options are linux-specific. 189 | ;; they also require tcp_keepalive=1 190 | 191 | ;; count of keepaliva packets 192 | ;tcp_keepcnt = 0 193 | 194 | ;; how long the connection can be idle, 195 | ;; before sending keepalive packets 196 | ;tcp_keepidle = 0 197 | 198 | ;; The time between individual keepalive probes. 199 | ;tcp_keepintvl = 0 200 | 201 | ;; DNS lookup caching time 202 | ;dns_max_ttl = 15 203 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | -------------------------------------------------------------------------------- /roles/postgresql/templates/postgresql.conf: -------------------------------------------------------------------------------- 1 | # ----------------------------- 2 | # PostgreSQL configuration file 3 | # ----------------------------- 4 | # 5 | # This file consists of lines of the form: 6 | # 7 | # name = value 8 | # 9 | # (The "=" is optional.) Whitespace may be used. Comments are introduced with 10 | # "#" anywhere on a line. The complete list of parameter names and allowed 11 | # values can be found in the PostgreSQL documentation. 12 | # 13 | # The commented-out settings shown in this file represent the default values. 14 | # Re-commenting a setting is NOT sufficient to revert it to the default value; 15 | # you need to reload the server. 16 | # 17 | # This file is read on server startup and when the server receives a SIGHUP 18 | # signal. If you edit the file on a running system, you have to SIGHUP the 19 | # server for the changes to take effect, or use "pg_ctl reload". Some 20 | # parameters, which are marked below, require a server shutdown and restart to 21 | # take effect. 22 | # 23 | # Any parameter can also be given as a command-line option to the server, e.g., 24 | # "postgres -c log_connections=on". Some parameters can be changed at run time 25 | # with the "SET" SQL command. 26 | # 27 | # Memory units: kB = kilobytes Time units: ms = milliseconds 28 | # MB = megabytes s = seconds 29 | # GB = gigabytes min = minutes 30 | # h = hours 31 | # d = days 32 | 33 | 34 | #------------------------------------------------------------------------------ 35 | # FILE LOCATIONS 36 | #------------------------------------------------------------------------------ 37 | 38 | # The default values of these variables are driven from the -D command-line 39 | # option or PGDATA environment variable, represented here as ConfigDir. 40 | 41 | data_directory = '/var/lib/postgresql/{{ postgresql.version }}/main' # use data in another directory 42 | # (change requires restart) 43 | hba_file = '/etc/postgresql/{{ postgresql.version }}/main/pg_hba.conf' # host-based authentication file 44 | # (change requires restart) 45 | ident_file = '/etc/postgresql/{{ postgresql.version }}/main/pg_ident.conf' # ident configuration file 46 | # (change requires restart) 47 | 48 | # If external_pid_file is not explicitly set, no extra PID file is written. 49 | external_pid_file = '/var/run/postgresql/{{ postgresql.version }}-main.pid' # write an extra PID file 50 | # (change requires restart) 51 | 52 | 53 | #------------------------------------------------------------------------------ 54 | # CONNECTIONS AND AUTHENTICATION 55 | #------------------------------------------------------------------------------ 56 | 57 | # - Connection Settings - 58 | 59 | #listen_addresses = 'localhost' # what IP address(es) to listen on; 60 | # comma-separated list of addresses; 61 | # defaults to 'localhost'; use '*' for all 62 | # (change requires restart) 63 | port = 5432 # (change requires restart) 64 | max_connections = 100 # (change requires restart) 65 | # Note: Increasing max_connections costs ~400 bytes of shared memory per 66 | # connection slot, plus lock space (see max_locks_per_transaction). 67 | #superuser_reserved_connections = 3 # (change requires restart) 68 | unix_socket_directory = '/var/run/postgresql' # (change requires restart) 69 | #unix_socket_group = '' # (change requires restart) 70 | #unix_socket_permissions = 0777 # begin with 0 to use octal notation 71 | # (change requires restart) 72 | #bonjour = off # advertise server via Bonjour 73 | # (change requires restart) 74 | #bonjour_name = '' # defaults to the computer name 75 | # (change requires restart) 76 | 77 | # - Security and Authentication - 78 | 79 | #authentication_timeout = 1min # 1s-600s 80 | ssl = true # (change requires restart) 81 | #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers 82 | # (change requires restart) 83 | #ssl_renegotiation_limit = 512MB # amount of data between renegotiations 84 | ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart) 85 | ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires restart) 86 | #ssl_ca_file = '' # (change requires restart) 87 | #ssl_crl_file = '' # (change requires restart) 88 | #password_encryption = on 89 | #db_user_namespace = off 90 | 91 | # Kerberos and GSSAPI 92 | #krb_server_keyfile = '' 93 | #krb_srvname = 'postgres' # (Kerberos only) 94 | #krb_caseins_users = off 95 | 96 | # - TCP Keepalives - 97 | # see "man 7 tcp" for details 98 | 99 | #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; 100 | # 0 selects the system default 101 | #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; 102 | # 0 selects the system default 103 | #tcp_keepalives_count = 0 # TCP_KEEPCNT; 104 | # 0 selects the system default 105 | 106 | 107 | #------------------------------------------------------------------------------ 108 | # RESOURCE USAGE (except WAL) 109 | #------------------------------------------------------------------------------ 110 | 111 | # - Memory - 112 | 113 | shared_buffers = {{ postgresql.config.shared_buffers }} # min 128kB 114 | # (change requires restart) 115 | #temp_buffers = 8MB # min 800kB 116 | #max_prepared_transactions = 0 # zero disables the feature 117 | # (change requires restart) 118 | # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory 119 | # per transaction slot, plus lock space (see max_locks_per_transaction). 120 | # It is not advisable to set max_prepared_transactions nonzero unless you 121 | # actively intend to use prepared transactions. 122 | work_mem = {{ postgresql.config.work_mem }} # min 64kB 123 | #maintenance_work_mem = 16MB # min 1MB 124 | #max_stack_depth = 2MB # min 100kB 125 | 126 | # - Disk - 127 | 128 | #temp_file_limit = -1 # limits per-session temp file space 129 | # in kB, or -1 for no limit 130 | 131 | # - Kernel Resource Usage - 132 | 133 | #max_files_per_process = 1000 # min 25 134 | # (change requires restart) 135 | #shared_preload_libraries = '' # (change requires restart) 136 | 137 | # - Cost-Based Vacuum Delay - 138 | 139 | #vacuum_cost_delay = 0ms # 0-100 milliseconds 140 | #vacuum_cost_page_hit = 1 # 0-10000 credits 141 | #vacuum_cost_page_miss = 10 # 0-10000 credits 142 | #vacuum_cost_page_dirty = 20 # 0-10000 credits 143 | #vacuum_cost_limit = 200 # 1-10000 credits 144 | 145 | # - Background Writer - 146 | 147 | #bgwriter_delay = 200ms # 10-10000ms between rounds 148 | #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round 149 | #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round 150 | 151 | # - Asynchronous Behavior - 152 | 153 | #effective_io_concurrency = 1 # 1-1000; 0 disables prefetching 154 | 155 | 156 | #------------------------------------------------------------------------------ 157 | # WRITE AHEAD LOG 158 | #------------------------------------------------------------------------------ 159 | 160 | # - Settings - 161 | 162 | #wal_level = minimal # minimal, archive, or hot_standby 163 | # (change requires restart) 164 | #fsync = on # turns forced synchronization on or off 165 | #synchronous_commit = on # synchronization level; 166 | # off, local, remote_write, or on 167 | #wal_sync_method = fsync # the default is the first option 168 | # supported by the operating system: 169 | # open_datasync 170 | # fdatasync (default on Linux) 171 | # fsync 172 | # fsync_writethrough 173 | # open_sync 174 | #full_page_writes = on # recover from partial page writes 175 | #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers 176 | # (change requires restart) 177 | #wal_writer_delay = 200ms # 1-10000 milliseconds 178 | 179 | #commit_delay = 0 # range 0-100000, in microseconds 180 | #commit_siblings = 5 # range 1-1000 181 | 182 | # - Checkpoints - 183 | 184 | checkpoint_segments = {{ postgresql.config.checkpoint_segments }} # in logfile segments, min 1, 16MB each 185 | #checkpoint_timeout = 5min # range 30s-1h 186 | checkpoint_completion_target = {{ postgresql.config.checkpoint_completion_target}} # checkpoint target duration, 0.0 - 1.0 187 | #checkpoint_warning = 30s # 0 disables 188 | 189 | # - Archiving - 190 | 191 | #archive_mode = off # allows archiving to be done 192 | # (change requires restart) 193 | #archive_command = '' # command to use to archive a logfile segment 194 | # placeholders: %p = path of file to archive 195 | # %f = file name only 196 | # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' 197 | #archive_timeout = 0 # force a logfile segment switch after this 198 | # number of seconds; 0 disables 199 | 200 | 201 | #------------------------------------------------------------------------------ 202 | # REPLICATION 203 | #------------------------------------------------------------------------------ 204 | 205 | # - Sending Server(s) - 206 | 207 | # Set these on the master and on any standby that will send replication data. 208 | 209 | #max_wal_senders = 0 # max number of walsender processes 210 | # (change requires restart) 211 | #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables 212 | #replication_timeout = 60s # in milliseconds; 0 disables 213 | 214 | # - Master Server - 215 | 216 | # These settings are ignored on a standby server. 217 | 218 | #synchronous_standby_names = '' # standby servers that provide sync rep 219 | # comma-separated list of application_name 220 | # from standby(s); '*' = all 221 | #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed 222 | 223 | # - Standby Servers - 224 | 225 | # These settings are ignored on a master server. 226 | 227 | #hot_standby = off # "on" allows queries during recovery 228 | # (change requires restart) 229 | #max_standby_archive_delay = 30s # max delay before canceling queries 230 | # when reading WAL from archive; 231 | # -1 allows indefinite delay 232 | #max_standby_streaming_delay = 30s # max delay before canceling queries 233 | # when reading streaming WAL; 234 | # -1 allows indefinite delay 235 | #wal_receiver_status_interval = 10s # send replies at least this often 236 | # 0 disables 237 | #hot_standby_feedback = off # send info from standby to prevent 238 | # query conflicts 239 | 240 | 241 | #------------------------------------------------------------------------------ 242 | # QUERY TUNING 243 | #------------------------------------------------------------------------------ 244 | 245 | # - Planner Method Configuration - 246 | 247 | #enable_bitmapscan = on 248 | #enable_hashagg = on 249 | #enable_hashjoin = on 250 | #enable_indexscan = on 251 | #enable_indexonlyscan = on 252 | #enable_material = on 253 | #enable_mergejoin = on 254 | #enable_nestloop = on 255 | #enable_seqscan = on 256 | #enable_sort = on 257 | #enable_tidscan = on 258 | 259 | # - Planner Cost Constants - 260 | 261 | #seq_page_cost = 1.0 # measured on an arbitrary scale 262 | #random_page_cost = 4.0 # same scale as above 263 | #cpu_tuple_cost = 0.01 # same scale as above 264 | #cpu_index_tuple_cost = 0.005 # same scale as above 265 | #cpu_operator_cost = 0.0025 # same scale as above 266 | effective_cache_size = {{ postgresql.config.effective_cache_size }} 267 | 268 | # - Genetic Query Optimizer - 269 | 270 | #geqo = on 271 | #geqo_threshold = 12 272 | #geqo_effort = 5 # range 1-10 273 | #geqo_pool_size = 0 # selects default based on effort 274 | #geqo_generations = 0 # selects default based on effort 275 | #geqo_selection_bias = 2.0 # range 1.5-2.0 276 | #geqo_seed = 0.0 # range 0.0-1.0 277 | 278 | # - Other Planner Options - 279 | 280 | #default_statistics_target = 100 # range 1-10000 281 | #constraint_exclusion = partition # on, off, or partition 282 | #cursor_tuple_fraction = 0.1 # range 0.0-1.0 283 | #from_collapse_limit = 8 284 | #join_collapse_limit = 8 # 1 disables collapsing of explicit 285 | # JOIN clauses 286 | 287 | 288 | #------------------------------------------------------------------------------ 289 | # ERROR REPORTING AND LOGGING 290 | #------------------------------------------------------------------------------ 291 | 292 | # - Where to Log - 293 | 294 | #log_destination = 'stderr' # Valid values are combinations of 295 | # stderr, csvlog, syslog, and eventlog, 296 | # depending on platform. csvlog 297 | # requires logging_collector to be on. 298 | 299 | # This is used when logging to stderr: 300 | #logging_collector = off # Enable capturing of stderr and csvlog 301 | # into log files. Required to be on for 302 | # csvlogs. 303 | # (change requires restart) 304 | 305 | # These are only used if logging_collector is on: 306 | #log_directory = 'pg_log' # directory where log files are written, 307 | # can be absolute or relative to PGDATA 308 | #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, 309 | # can include strftime() escapes 310 | #log_file_mode = 0600 # creation mode for log files, 311 | # begin with 0 to use octal notation 312 | #log_truncate_on_rotation = off # If on, an existing log file with the 313 | # same name as the new log file will be 314 | # truncated rather than appended to. 315 | # But such truncation only occurs on 316 | # time-driven rotation, not on restarts 317 | # or size-driven rotation. Default is 318 | # off, meaning append to existing files 319 | # in all cases. 320 | #log_rotation_age = 1d # Automatic rotation of logfiles will 321 | # happen after that time. 0 disables. 322 | #log_rotation_size = 10MB # Automatic rotation of logfiles will 323 | # happen after that much log output. 324 | # 0 disables. 325 | 326 | # These are relevant when logging to syslog: 327 | #syslog_facility = 'LOCAL0' 328 | #syslog_ident = 'postgres' 329 | 330 | # This is only relevant when logging to eventlog (win32): 331 | #event_source = 'PostgreSQL' 332 | 333 | # - When to Log - 334 | 335 | #client_min_messages = notice # values in order of decreasing detail: 336 | # debug5 337 | # debug4 338 | # debug3 339 | # debug2 340 | # debug1 341 | # log 342 | # notice 343 | # warning 344 | # error 345 | 346 | #log_min_messages = warning # values in order of decreasing detail: 347 | # debug5 348 | # debug4 349 | # debug3 350 | # debug2 351 | # debug1 352 | # info 353 | # notice 354 | # warning 355 | # error 356 | # log 357 | # fatal 358 | # panic 359 | 360 | #log_min_error_statement = error # values in order of decreasing detail: 361 | # debug5 362 | # debug4 363 | # debug3 364 | # debug2 365 | # debug1 366 | # info 367 | # notice 368 | # warning 369 | # error 370 | # log 371 | # fatal 372 | # panic (effectively off) 373 | 374 | #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements 375 | # and their durations, > 0 logs only 376 | # statements running at least this number 377 | # of milliseconds 378 | 379 | 380 | # - What to Log - 381 | 382 | #debug_print_parse = off 383 | #debug_print_rewritten = off 384 | #debug_print_plan = off 385 | #debug_pretty_print = on 386 | #log_checkpoints = off 387 | #log_connections = off 388 | #log_disconnections = off 389 | #log_duration = off 390 | #log_error_verbosity = default # terse, default, or verbose messages 391 | #log_hostname = off 392 | log_line_prefix = '%t ' # special values: 393 | # %a = application name 394 | # %u = user name 395 | # %d = database name 396 | # %r = remote host and port 397 | # %h = remote host 398 | # %p = process ID 399 | # %t = timestamp without milliseconds 400 | # %m = timestamp with milliseconds 401 | # %i = command tag 402 | # %e = SQL state 403 | # %c = session ID 404 | # %l = session line number 405 | # %s = session start timestamp 406 | # %v = virtual transaction ID 407 | # %x = transaction ID (0 if none) 408 | # %q = stop here in non-session 409 | # processes 410 | # %% = '%' 411 | # e.g. '<%u%%%d> ' 412 | #log_lock_waits = off # log lock waits >= deadlock_timeout 413 | #log_statement = 'none' # none, ddl, mod, all 414 | #log_temp_files = -1 # log temporary files equal or larger 415 | # than the specified size in kilobytes; 416 | # -1 disables, 0 logs all temp files 417 | log_timezone = 'UTC' 418 | 419 | 420 | #------------------------------------------------------------------------------ 421 | # RUNTIME STATISTICS 422 | #------------------------------------------------------------------------------ 423 | 424 | # - Query/Index Statistics Collector - 425 | 426 | #track_activities = on 427 | #track_counts = on 428 | #track_io_timing = off 429 | #track_functions = none # none, pl, all 430 | #track_activity_query_size = 1024 # (change requires restart) 431 | #update_process_title = on 432 | #stats_temp_directory = 'pg_stat_tmp' 433 | 434 | 435 | # - Statistics Monitoring - 436 | 437 | #log_parser_stats = off 438 | #log_planner_stats = off 439 | #log_executor_stats = off 440 | #log_statement_stats = off 441 | 442 | 443 | #------------------------------------------------------------------------------ 444 | # AUTOVACUUM PARAMETERS 445 | #------------------------------------------------------------------------------ 446 | 447 | #autovacuum = on # Enable autovacuum subprocess? 'on' 448 | # requires track_counts to also be on. 449 | #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and 450 | # their durations, > 0 logs only 451 | # actions running at least this number 452 | # of milliseconds. 453 | #autovacuum_max_workers = 3 # max number of autovacuum subprocesses 454 | # (change requires restart) 455 | #autovacuum_naptime = 1min # time between autovacuum runs 456 | #autovacuum_vacuum_threshold = 50 # min number of row updates before 457 | # vacuum 458 | #autovacuum_analyze_threshold = 50 # min number of row updates before 459 | # analyze 460 | #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum 461 | #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze 462 | #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum 463 | # (change requires restart) 464 | #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for 465 | # autovacuum, in milliseconds; 466 | # -1 means use vacuum_cost_delay 467 | #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for 468 | # autovacuum, -1 means use 469 | # vacuum_cost_limit 470 | 471 | 472 | #------------------------------------------------------------------------------ 473 | # CLIENT CONNECTION DEFAULTS 474 | #------------------------------------------------------------------------------ 475 | 476 | # - Statement Behavior - 477 | 478 | #search_path = '"$user",public' # schema names 479 | #default_tablespace = '' # a tablespace name, '' uses the default 480 | #temp_tablespaces = '' # a list of tablespace names, '' uses 481 | # only default tablespace 482 | #check_function_bodies = on 483 | #default_transaction_isolation = 'read committed' 484 | #default_transaction_read_only = off 485 | #default_transaction_deferrable = off 486 | #session_replication_role = 'origin' 487 | #statement_timeout = 0 # in milliseconds, 0 is disabled 488 | #vacuum_freeze_min_age = 50000000 489 | #vacuum_freeze_table_age = 150000000 490 | #bytea_output = 'hex' # hex, escape 491 | #xmlbinary = 'base64' 492 | #xmloption = 'content' 493 | 494 | # - Locale and Formatting - 495 | 496 | datestyle = 'iso, mdy' 497 | #intervalstyle = 'postgres' 498 | #timezone = 'UTC' 499 | #timezone_abbreviations = 'Default' # Select the set of available time zone 500 | # abbreviations. Currently, there are 501 | # Default 502 | # Australia 503 | # India 504 | # You can create your own file in 505 | # share/timezonesets/. 506 | #extra_float_digits = 0 # min -15, max 3 507 | #client_encoding = sqlascii # actually, defaults to database 508 | # encoding, default sqlascii 509 | 510 | # These settings are initialized by initdb, but they can be changed. 511 | lc_messages = 'en_US.UTF-8' # locale for system error message 512 | # strings 513 | lc_monetary = 'en_US.UTF-8' # locale for monetary formatting 514 | lc_numeric = 'en_US.UTF-8' # locale for number formatting 515 | lc_time = 'en_US.UTF-8' # locale for time formatting 516 | 517 | # default configuration for text search 518 | default_text_search_config = 'pg_catalog.english' 519 | 520 | # - Other Defaults - 521 | 522 | #dynamic_library_path = '$libdir' 523 | #local_preload_libraries = '' 524 | 525 | 526 | #------------------------------------------------------------------------------ 527 | # LOCK MANAGEMENT 528 | #------------------------------------------------------------------------------ 529 | 530 | #deadlock_timeout = 1s 531 | #max_locks_per_transaction = 64 # min 10 532 | # (change requires restart) 533 | # Note: Each lock table slot uses ~270 bytes of shared memory, and there are 534 | # max_locks_per_transaction * (max_connections + max_prepared_transactions) 535 | # lock table slots. 536 | #max_pred_locks_per_transaction = 64 # min 10 537 | # (change requires restart) 538 | 539 | 540 | #------------------------------------------------------------------------------ 541 | # VERSION/PLATFORM COMPATIBILITY 542 | #------------------------------------------------------------------------------ 543 | 544 | # - Previous PostgreSQL Versions - 545 | 546 | #array_nulls = on 547 | #backslash_quote = safe_encoding # on, off, or safe_encoding 548 | #default_with_oids = off 549 | #escape_string_warning = on 550 | #lo_compat_privileges = off 551 | #quote_all_identifiers = off 552 | #sql_inheritance = on 553 | #standard_conforming_strings = on 554 | #synchronize_seqscans = on 555 | 556 | # - Other Platforms and Clients - 557 | 558 | #transform_null_equals = off 559 | 560 | 561 | #------------------------------------------------------------------------------ 562 | # ERROR HANDLING 563 | #------------------------------------------------------------------------------ 564 | 565 | #exit_on_error = off # terminate session on any error? 566 | #restart_after_crash = on # reinitialize after backend crash? 567 | 568 | 569 | #------------------------------------------------------------------------------ 570 | # CUSTOMIZED OPTIONS 571 | #------------------------------------------------------------------------------ 572 | 573 | # Add settings for extensions here 574 | client_encoding = 'UTF8' 575 | default_transaction_isolation = 'read committed' 576 | timezone = 'UTC' 577 | --------------------------------------------------------------------------------