~brad-marshall/charms/trusty/postgresql/fix-cron-backups

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#------------------------------------------------------------------------------
# This file is managed by Juju
#------------------------------------------------------------------------------


#------------------------------------------------------------------------------
# FILE LOCATIONS
#------------------------------------------------------------------------------

data_directory = '/var/lib/postgresql/{{version}}/{{cluster_name}}'
hba_file = '/etc/postgresql/{{version}}/{{cluster_name}}/pg_hba.conf'
ident_file = '/etc/postgresql/{{version}}/{{cluster_name}}/pg_ident.conf'
external_pid_file = '/var/run/postgresql/{{version}}-{{cluster_name}}.pid'


#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

{% if version >= "9.3" -%}
unix_socket_directories = '/var/run/postgresql'
{% else -%}
unix_socket_directory = '/var/run/postgresql'
{% endif -%}

{% if version >= "9.2" -%}
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'
{% endif -%}

{% if listen_ip != "" -%}
listen_addresses = '{{listen_ip}}'
{% endif -%}
{% if listen_port != "" -%}
port = '{{listen_port}}'
{% endif -%}
{% if ssl != "" -%}
ssl = {{ssl}}
{% endif -%}
{% if max_connections != "" -%}
max_connections = {{max_connections}}
{% endif -%}


#------------------------------------------------------------------------------
# RESOURCE USAGE (except WAL)
#------------------------------------------------------------------------------

{% if shared_buffers != "" -%}
shared_buffers = {{shared_buffers}}
{% endif -%}
{% if temp_buffers != "" -%}
temp_buffers = {{temp_buffers}}
{% endif -%}
{% if work_mem != "" -%}
work_mem = {{work_mem}}
{% endif -%}
{% if maintenance_work_mem != "" -%}
maintenance_work_mem = {{maintenance_work_mem}}
{% endif -%}


#------------------------------------------------------------------------------
# WRITE AHEAD LOG
#------------------------------------------------------------------------------

{% if wal_buffers  != "" -%}
wal_buffers = {{wal_buffers}}
{% endif -%}
{% if checkpoint_segments  != "" -%}
checkpoint_segments = {{checkpoint_segments}}
{% endif -%}
{% if checkpoint_timeout  != "" -%}
checkpoint_timeout = {{checkpoint_timeout}}
{% endif -%}
{% if fsync  != "" -%}
fsync = {{fsync}}
{% endif -%}
{% if synchronous_commit  != "" -%}
synchronous_commit = {{synchronous_commit}}
{% endif -%}
{% if full_page_writes  != "" -%}
full_page_writes = {{full_page_writes}}
{% endif -%}


#------------------------------------------------------------------------------
# QUERY TUNING
#------------------------------------------------------------------------------

{% if random_page_cost  != "" -%}
random_page_cost = {{random_page_cost}}
{% endif -%}
{% if effective_cache_size  != "" -%}
effective_cache_size = {{effective_cache_size}}
{% endif -%}


#------------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------

include 'juju_logdest.conf'

{% if log_min_duration_statement  != "" -%}
log_min_duration_statement = {{log_min_duration_statement}}
{% endif -%}
{% if log_checkpoints  != "" -%}
log_checkpoints = {{log_checkpoints}}
{% endif -%}
{% if log_connections  != "" -%}
log_connections = {{log_connections}}
{% endif -%}
{% if log_disconnections  != "" -%}
log_disconnections = {{log_disconnections}}
{% endif -%}
{% if log_line_prefix  != "" -%}
log_line_prefix = '{{log_line_prefix}}'
{% endif -%}
{% if log_lock_waits  != "" -%}
log_lock_waits = {{log_lock_waits}}
{% endif -%}
{% if log_temp_files != "" -%}
log_temp_files = {{log_temp_files}}
{% endif -%}

log_timezone = UTC


#------------------------------------------------------------------------------
# AUTOVACUUM PARAMETERS
#------------------------------------------------------------------------------

{% if autovacuum  != "" -%}
autovacuum = {{autovacuum}}
{% endif -%}
{% if log_autovacuum_min_duration  != "" -%}
log_autovacuum_min_duration = {{log_autovacuum_min_duration}}
{% endif -%}
{% if autovacuum_analyze_threshold  != "" -%}
autovacuum_analyze_threshold = {{autovacuum_analyze_threshold}}
{% endif -%}
{% if autovacuum_vacuum_scale_factor  != "" -%}
autovacuum_vacuum_scale_factor = {{autovacuum_vacuum_scale_factor}}
{% endif -%}
{% if autovacuum_analyze_scale_factor  != "" -%}
autovacuum_analyze_scale_factor = {{autovacuum_analyze_scale_factor}}
{% endif -%}
{% if autovacuum_vacuum_cost_delay  != "" -%}
autovacuum_vacuum_cost_delay = {{autovacuum_vacuum_cost_delay}}
{% endif -%}


#------------------------------------------------------------------------------
# CLIENT CONNECTION DEFAULTS
#------------------------------------------------------------------------------

{% if search_path  != "" -%}
search_path = '{{search_path}}'
{% endif -%}


#------------------------------------------------------------------------------
# VERSION/PLATFORM COMPATIBILITY
#------------------------------------------------------------------------------

{% if standard_conforming_strings  != "" -%}
standard_conforming_strings = {{standard_conforming_strings}}
{% endif -%}

{% if version >= "9.0" -%}
#------------------------------------------------------------------------------
# Replication
#------------------------------------------------------------------------------
{% if hot_standby  != "" -%}
hot_standby = {{hot_standby}}
{% endif -%}
{% if hot_standby_feedback  != "" -%}
hot_standby_feedback = {{hot_standby_feedback}}
{% endif -%}
{% if wal_level  != "" -%}
wal_level = {{wal_level}}
{% endif -%}
{% if max_wal_senders  != "" -%}
max_wal_senders = {{max_wal_senders}}
{% endif -%}
{% if wal_keep_segments  != "" -%}
wal_keep_segments = {{wal_keep_segments}}
{% endif -%}
{% if archive_mode != "" -%}
archive_mode = {{archive_mode}}
{% endif -%}
{% if archive_command != "" -%}
archive_command = '{{archive_command}}'
{% endif -%}

{% endif -%}