· 7 years ago · Jan 25, 2019, 08:48 AM
1# WRITE-AHEAD LOG
2#------------------------------------------------------------------------------
3
4# - Settings -
5
6#wal_level = replica # minimal, replica, or logical
7 # (change requires restart)
8#fsync = on # flush data to disk for crash safety
9 # (turning this off can cause
10 # unrecoverable data corruption)
11#synchronous_commit = on # synchronization level;
12 # off, local, remote_write, remote_apply, or on
13#wal_sync_method = fsync # the default is the first option
14 # supported by the operating system:
15 # open_datasync
16 # fdatasync (default on Linux)
17 # fsync
18 # fsync_writethrough
19 # open_sync
20#full_page_writes = on # recover from partial page writes
21#wal_compression = off # enable compression of full-page writes
22#wal_log_hints = off # also do full page writes of non-critical updates
23 # (change requires restart)
24#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
25 # (change requires restart)
26#wal_writer_delay = 200ms # 1-10000 milliseconds
27#wal_writer_flush_after = 1MB # measured in pages, 0 disables
28
29#commit_delay = 0 # range 0-100000, in microseconds
30#commit_siblings = 5 # range 1-1000
31
32# - Checkpoints -
33
34#checkpoint_timeout = 5min # range 30s-1d
35max_wal_size = 1GB
36min_wal_size = 80MB
37#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
38#checkpoint_flush_after = 256kB # measured in pages, 0 disables
39#checkpoint_warning = 30s # 0 disables
40
41# - Archiving -
42
43#archive_mode = off # enables archiving; off, on, or always
44 # (change requires restart)
45#archive_command = '' # command to use to archive a logfile segment
46 # placeholders: %p = path of file to archive
47 # %f = file name only
48 # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
49#archive_timeout = 0 # force a logfile segment switch after this
50 # number of seconds; 0 disables
51
52
53#------------------------------------------------------------------------------
54# REPLICATION
55#------------------------------------------------------------------------------
56
57# - Sending Servers -
58
59# Set these on the master and on any standby that will send replication data.
60
61#max_wal_senders = 10 # max number of walsender processes
62 # (change requires restart)
63#wal_keep_segments = 0 # in logfile segments; 0 disables
64#wal_sender_timeout = 60s # in milliseconds; 0 disables
65
66#max_replication_slots = 10 # max number of replication slots
67 # (change requires restart)
68#track_commit_timestamp = off # collect timestamp of transaction commit
69 # (change requires restart)
70
71# - Master Server -
72
73# These settings are ignored on a standby server.
74
75#synchronous_standby_names = '' # standby servers that provide sync rep
76 # method to choose sync standbys, number of sync standbys,
77 # and comma-separated list of application_name
78 # from standby(s); '*' = all
79#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
80
81# - Standby Servers -
82
83# These settings are ignored on a master server.
84
85#hot_standby = on # "off" disallows queries during recovery
86 # (change requires restart)
87#max_standby_archive_delay = 30s # max delay before canceling queries
88 # when reading WAL from archive;
89 # -1 allows indefinite delay
90#max_standby_streaming_delay = 30s # max delay before canceling queries
91 # when reading streaming WAL;
92 # -1 allows indefinite delay
93#wal_receiver_status_interval = 10s # send replies at least this often
94 # 0 disables
95#hot_standby_feedback = off # send info from standby to prevent
96 # query conflicts
97#wal_receiver_timeout = 60s # time that receiver waits for
98 # communication from master
99 # in milliseconds; 0 disables
100#wal_retrieve_retry_interval = 5s # time to wait before retrying to
101 # retrieve WAL after a failed attempt
102
103# - Subscribers -
104
105# These settings are ignored on a publisher.
106
107#max_logical_replication_workers = 4 # taken from max_worker_processes
108 # (change requires restart)
109#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers
110
111
112#------------------------------------------------------------------------------
113# QUERY TUNING
114#------------------------------------------------------------------------------
115
116# - Planner Method Configuration -
117
118#enable_bitmapscan = on
119#enable_hashagg = on
120#enable_hashjoin = on
121#enable_indexscan = on
122#enable_indexonlyscan = on
123#enable_material = on
124#enable_mergejoin = on
125#enable_nestloop = on
126#enable_parallel_append = on
127#enable_seqscan = on
128#enable_sort = on
129#enable_tidscan = on
130#enable_partitionwise_join = off
131#enable_partitionwise_aggregate = off
132#enable_parallel_hash = on
133#enable_partition_pruning = on
134
135# - Planner Cost Constants -
136
137#seq_page_cost = 1.0 # measured on an arbitrary scale
138#random_page_cost = 4.0 # same scale as above
139#cpu_tuple_cost = 0.01 # same scale as above
140#cpu_index_tuple_cost = 0.005 # same scale as above
141#cpu_operator_cost = 0.0025 # same scale as above
142#parallel_tuple_cost = 0.1 # same scale as above
143#parallel_setup_cost = 1000.0 # same scale as above
144
145#jit_above_cost = 100000 # perform JIT compilation if available
146 # and query more expensive than this;
147 # -1 disables
148#jit_inline_above_cost = 500000 # inline small functions if query is
149 # more expensive than this; -1 disables
150#jit_optimize_above_cost = 500000 # use expensive JIT optimizations if
151 # query is more expensive than this;
152 # -1 disables
153
154#min_parallel_table_scan_size = 8MB
155#min_parallel_index_scan_size = 512kB
156#effective_cache_size = 4GB
157
158# - Genetic Query Optimizer -
159
160#geqo = on
161#geqo_threshold = 12
162#geqo_effort = 5 # range 1-10
163#geqo_pool_size = 0 # selects default based on effort
164#geqo_generations = 0 # selects default based on effort
165#geqo_selection_bias = 2.0 # range 1.5-2.0
166#geqo_seed = 0.0 # range 0.0-1.0
167
168# - Other Planner Options -
169
170#default_statistics_target = 100 # range 1-10000
171#constraint_exclusion = partition # on, off, or partition
172#cursor_tuple_fraction = 0.1 # range 0.0-1.0
173#from_collapse_limit = 8
174#join_collapse_limit = 8 # 1 disables collapsing of explicit
175 # JOIN clauses
176#force_parallel_mode = off
177#jit = off # allow JIT compilation
178
179
180#------------------------------------------------------------------------------
181# REPORTING AND LOGGING
182#------------------------------------------------------------------------------
183
184# - Where to Log -
185
186#log_destination = 'stderr' # Valid values are combinations of
187 # stderr, csvlog, syslog, and eventlog,
188 # depending on platform. csvlog
189 # requires logging_collector to be on.
190
191# This is used when logging to stderr:
192#logging_collector = off # Enable capturing of stderr and csvlog
193 # into log files. Required to be on for
194 # csvlogs.
195 # (change requires restart)
196
197# These are only used if logging_collector is on:
198#log_directory = 'log' # directory where log files are written,
199 # can be absolute or relative to PGDATA
200#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
201 # can include strftime() escapes
202#log_file_mode = 0600 # creation mode for log files,
203 # begin with 0 to use octal notation
204#log_truncate_on_rotation = off # If on, an existing log file with the
205 # same name as the new log file will be
206 # truncated rather than appended to.
207 # But such truncation only occurs on
208 # time-driven rotation, not on restarts
209 # or size-driven rotation. Default is
210 # off, meaning append to existing files
211 # in all cases.
212#log_rotation_age = 1d # Automatic rotation of logfiles will
213 # happen after that time. 0 disables.
214#log_rotation_size = 10MB # Automatic rotation of logfiles will
215 # happen after that much log output.
216 # 0 disables.
217
218# These are relevant when logging to syslog:
219#syslog_facility = 'LOCAL0'
220#syslog_ident = 'postgres'
221#syslog_sequence_numbers = on
222#syslog_split_messages = on
223
224# This is only relevant when logging to eventlog (win32):
225# (change requires restart)
226#event_source = 'PostgreSQL'
227
228# - When to Log -
229
230#client_min_messages = notice # values in order of decreasing detail:
231 # debug5
232 # debug4
233 # debug3
234 # debug2
235 # debug1
236 # log
237 # notice
238 # warning
239 # error
240
241#log_min_messages = warning # values in order of decreasing detail:
242 # debug5
243 # debug4
244 # debug3
245 # debug2
246 # debug1
247 # info
248 # notice
249 # warning
250 # error
251 # log
252 # fatal
253 # panic
254
255#log_min_error_statement = error # values in order of decreasing detail:
256 # debug5
257 # debug4
258 # debug3
259 # debug2
260 # debug1
261 # info
262 # notice
263 # warning
264 # error
265 # log
266 # fatal
267 # panic (effectively off)
268
269#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
270 # and their durations, > 0 logs only
271 # statements running at least this number
272 # of milliseconds
273
274
275# - What to Log -
276
277#debug_print_parse = off
278#debug_print_rewritten = off
279#debug_print_plan = off
280#debug_pretty_print = on
281#log_checkpoints = off
282#log_connections = off
283#log_disconnections = off
284#log_duration = off
285#log_error_verbosity = default # terse, default, or verbose messages
286#log_hostname = off
287#log_line_prefix = '%m [%p] ' # special values:
288 # %a = application name
289 # %u = user name
290 # %d = database name
291 # %r = remote host and port
292 # %h = remote host
293 # %p = process ID
294 # %t = timestamp without milliseconds
295 # %m = timestamp with milliseconds
296 # %n = timestamp with milliseconds (as a Unix epoch)
297 # %i = command tag
298 # %e = SQL state
299 # %c = session ID
300 # %l = session line number
301 # %s = session start timestamp
302 # %v = virtual transaction ID
303 # %x = transaction ID (0 if none)
304 # %q = stop here in non-session
305 # processes
306 # %% = '%'
307 # e.g. '<%u%%%d> '
308#log_lock_waits = off # log lock waits >= deadlock_timeout
309#log_statement = 'none' # none, ddl, mod, all
310#log_replication_commands = off
311#log_temp_files = -1 # log temporary files equal or larger
312 # than the specified size in kilobytes;
313 # -1 disables, 0 logs all temp files
314log_timezone = 'Asia/Irkutsk'
315
316#------------------------------------------------------------------------------
317# PROCESS TITLE
318#------------------------------------------------------------------------------
319
320#cluster_name = '' # added to process titles if nonempty
321 # (change requires restart)
322#update_process_title = on
323
324
325#------------------------------------------------------------------------------
326# STATISTICS
327#------------------------------------------------------------------------------
328
329# - Query and Index Statistics Collector -
330
331#track_activities = on
332#track_counts = on
333#track_io_timing = off
334#track_functions = none # none, pl, all
335#track_activity_query_size = 1024 # (change requires restart)
336#stats_temp_directory = 'pg_stat_tmp'
337
338
339# - Monitoring -
340
341#log_parser_stats = off
342#log_planner_stats = off
343#log_executor_stats = off
344#log_statement_stats = off
345
346
347#------------------------------------------------------------------------------
348# AUTOVACUUM
349#------------------------------------------------------------------------------
350
351#autovacuum = on # Enable autovacuum subprocess? 'on'
352 # requires track_counts to also be on.
353#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
354 # their durations, > 0 logs only
355 # actions running at least this number
356 # of milliseconds.
357#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
358 # (change requires restart)
359#autovacuum_naptime = 1min # time between autovacuum runs
360#autovacuum_vacuum_threshold = 50 # min number of row updates before
361 # vacuum
362#autovacuum_analyze_threshold = 50 # min number of row updates before
363 # analyze
364#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
365#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
366#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
367 # (change requires restart)
368#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
369 # before forced vacuum
370 # (change requires restart)
371#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
372 # autovacuum, in milliseconds;
373 # -1 means use vacuum_cost_delay
374#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
375 # autovacuum, -1 means use
376 # vacuum_cost_limit
377
378
379#------------------------------------------------------------------------------
380# CLIENT CONNECTION DEFAULTS
381#------------------------------------------------------------------------------
382
383# - Statement Behavior -
384
385#search_path = '"$user", public' # schema names
386#row_security = on
387#default_tablespace = '' # a tablespace name, '' uses the default
388#temp_tablespaces = '' # a list of tablespace names, '' uses
389 # only default tablespace
390#check_function_bodies = on
391#default_transaction_isolation = 'read committed'
392#default_transaction_read_only = off
393#default_transaction_deferrable = off
394#session_replication_role = 'origin'
395#statement_timeout = 0 # in milliseconds, 0 is disabled
396#lock_timeout = 0 # in milliseconds, 0 is disabled
397#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled
398#vacuum_freeze_min_age = 50000000
399#vacuum_freeze_table_age = 150000000
400#vacuum_multixact_freeze_min_age = 5000000
401#vacuum_multixact_freeze_table_age = 150000000
402#vacuum_cleanup_index_scale_factor = 0.1 # fraction of total number of tuples
403 # before index cleanup, 0 always performs
404 # index cleanup
405#bytea_output = 'hex' # hex, escape
406#xmlbinary = 'base64'
407#xmloption = 'content'
408#gin_fuzzy_search_limit = 0
409#gin_pending_list_limit = 4MB
410
411# - Locale and Formatting -
412
413datestyle = 'iso, dmy'
414#intervalstyle = 'postgres'
415timezone = 'Asia/Irkutsk'
416#timezone_abbreviations = 'Default' # Select the set of available time zone
417 # abbreviations. Currently, there are
418 # Default
419 # Australia (historical usage)
420 # India
421 # You can create your own file in
422 # share/timezonesets/.
423#extra_float_digits = 0 # min -15, max 3
424#client_encoding = sql_ascii # actually, defaults to database
425 # encoding
426
427# These settings are initialized by initdb, but they can be changed.
428lc_messages = 'ru_RU.UTF-8' # locale for system error message
429 # strings
430lc_monetary = 'ru_RU.UTF-8' # locale for monetary formatting
431lc_numeric = 'ru_RU.UTF-8' # locale for number formatting
432lc_time = 'ru_RU.UTF-8' # locale for time formatting
433
434# default configuration for text search
435default_text_search_config = 'pg_catalog.russian'
436
437# - Shared Library Preloading -
438
439#shared_preload_libraries = '' # (change requires restart)
440#local_preload_libraries = ''
441#session_preload_libraries = ''
442#jit_provider = 'llvmjit' # JIT library to use
443
444# - Other Defaults -
445
446#dynamic_library_path = '$libdir'
447
448
449#------------------------------------------------------------------------------
450# LOCK MANAGEMENT
451#------------------------------------------------------------------------------
452
453#deadlock_timeout = 1s
454#max_locks_per_transaction = 64 # min 10
455 # (change requires restart)
456#max_pred_locks_per_transaction = 64 # min 10
457 # (change requires restart)
458#max_pred_locks_per_relation = -2 # negative values mean
459 # (max_pred_locks_per_transaction
460 # / -max_pred_locks_per_relation) - 1
461#max_pred_locks_per_page = 2 # min 0
462
463
464#------------------------------------------------------------------------------
465# VERSION AND PLATFORM COMPATIBILITY
466#------------------------------------------------------------------------------
467
468# - Previous PostgreSQL Versions -
469
470#array_nulls = on
471#backslash_quote = safe_encoding # on, off, or safe_encoding
472#default_with_oids = off
473#escape_string_warning = on
474#lo_compat_privileges = off
475#operator_precedence_warning = off
476#quote_all_identifiers = off
477#standard_conforming_strings = on
478#synchronize_seqscans = on
479
480# - Other Platforms and Clients -
481
482#transform_null_equals = off
483
484
485#------------------------------------------------------------------------------
486# ERROR HANDLING
487#------------------------------------------------------------------------------
488
489#exit_on_error = off # terminate session on any error?
490#restart_after_crash = on # reinitialize after backend crash?
491
492
493#------------------------------------------------------------------------------
494# CONFIG FILE INCLUDES
495#------------------------------------------------------------------------------
496
497# These options allow settings to be loaded from files other than the
498# default postgresql.conf.
499
500#include_dir = 'conf.d' # include files ending in '.conf' from
501 # directory 'conf.d'
502#include_if_exists = 'exists.conf' # include file only if it exists
503#include = 'special.conf' # include file
504
505
506#------------------------------------------------------------------------------
507# CUSTOMIZED OPTIONS
508#------------------------------------------------------------------------------
509
510# Add settings for extensions here