· 9 years ago · Jan 10, 2017, 03:56 PM
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# TB = terabytes 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
41data_directory = '/var/lib/postgresql/9.4/main' # use data in another directory
42 # (change requires restart)
43hba_file = '/etc/postgresql/9.4/main/pg_hba.conf' # host-based authentication file
44 # (change requires restart)
45ident_file = '/etc/postgresql/9.4/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.
49external_pid_file = '/var/run/postgresql/9.4-main.pid' # write an extra PID file
50 # (change requires restart)
51
52
53#------------------------------------------------------------------------------
54# CONNECTIONS AND AUTHENTICATION
55#------------------------------------------------------------------------------
56
57# - Connection Settings -
58
59listen_addresses = '*' # what IP address(es) to listen on;
60 # comma-separated list of addresses;
61 # defaults to 'localhost'; use '*' for all
62 # (change requires restart)
63port = 5432 # (change requires restart)
64#max_connections = 30 # (change requires restart)
65#superuser_reserved_connections = 3 # (change requires restart)
66unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
67 # (change requires restart)
68#unix_socket_group = '' # (change requires restart)
69#unix_socket_permissions = 0777 # begin with 0 to use octal notation
70 # (change requires restart)
71#bonjour = off # advertise server via Bonjour
72 # (change requires restart)
73#bonjour_name = '' # defaults to the computer name
74 # (change requires restart)
75
76# - Security and Authentication -
77
78#authentication_timeout = 1min # 1s-600s
79ssl = true # (change requires restart)
80#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
81 # (change requires restart)
82#ssl_prefer_server_ciphers = on # (change requires restart)
83#ssl_ecdh_curve = 'prime256v1' # (change requires restart)
84#ssl_renegotiation_limit = 0 # amount of data between renegotiations
85ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart)
86ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires restart)
87#ssl_ca_file = '' # (change requires restart)
88#ssl_crl_file = '' # (change requires restart)
89#password_encryption = on
90#db_user_namespace = off
91
92# GSSAPI using Kerberos
93#krb_server_keyfile = ''
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 = 2GB # min 128kB
114shared_buffers = 32MB # min 128kB
115 # (change requires restart)
116#huge_pages = try # on, off, or try
117 # (change requires restart)
118#temp_buffers = 8MB # min 800kB
119#max_prepared_transactions = 0 # zero disables the feature
120 # (change requires restart)
121# Caution: it is not advisable to set max_prepared_transactions nonzero unless
122# you actively intend to use prepared transactions.
123#work_mem = 35MB # min 64kB
124work_mem = 1MB # min 64kB
125#maintenance_work_mem = 1GB # min 1MB
126maintenance_work_mem = 16MB # min 1MB
127#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
128#max_stack_depth = 2MB # min 100kB
129dynamic_shared_memory_type = posix # the default is the first option
130 # supported by the operating system:
131 # posix
132 # sysv
133 # windows
134 # mmap
135 # use none to disable dynamic shared memory
136
137# - Disk -
138
139#temp_file_limit = -1 # limits per-session temp file space
140 # in kB, or -1 for no limit
141
142# - Kernel Resource Usage -
143
144#max_files_per_process = 1000 # min 25
145 # (change requires restart)
146#shared_preload_libraries = '' # (change requires restart)
147
148# - Cost-Based Vacuum Delay -
149
150#vacuum_cost_delay = 0 # 0-100 milliseconds
151#vacuum_cost_page_hit = 1 # 0-10000 credits
152#vacuum_cost_page_miss = 10 # 0-10000 credits
153#vacuum_cost_page_dirty = 20 # 0-10000 credits
154#vacuum_cost_limit = 200 # 1-10000 credits
155
156# - Background Writer -
157
158#bgwriter_delay = 200ms # 10-10000ms between rounds
159#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
160#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round
161
162# - Asynchronous Behavior -
163
164#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching
165#max_worker_processes = 8
166
167
168#------------------------------------------------------------------------------
169# WRITE AHEAD LOG
170#------------------------------------------------------------------------------
171
172# - Settings -
173
174#wal_level = minimal # minimal, archive, hot_standby, or logical # (change requires restart)
175#fsync = on # turns forced synchronization on or off
176#synchronous_commit = on # synchronization level;
177 # off, local, remote_write, or on
178#wal_sync_method = fsync # the default is the first option
179 # supported by the operating system:
180 # open_datasync
181 # fdatasync (default on Linux)
182 # fsync
183 # fsync_writethrough
184 # open_sync
185#full_page_writes = on # recover from partial page writes
186#wal_log_hints = off # also do full page writes of non-critical updates
187 # (change requires restart)
188wal_buffers = 16MB # min 32kB, -1 sets based on shared_buffers
189 # (change requires restart)
190#wal_writer_delay = 200ms # 1-10000 milliseconds
191
192#commit_delay = 0 # range 0-100000, in microseconds
193#commit_siblings = 5 # range 1-1000
194# - Checkpoints -
195#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
196#checkpoint_timeout = 5min # range 30s-1h
197checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
198#checkpoint_warning = 30s # 0 disables
199
200# - Archiving -
201
202#archive_mode = off # allows archiving to be done
203 # (change requires restart)
204#archive_command = '' # command to use to archive a logfile segment
205 # placeholders: %p = path of file to archive
206 # %f = file name only
207 # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
208#archive_timeout = 0 # force a logfile segment switch after this
209 # number of seconds; 0 disables
210
211
212#------------------------------------------------------------------------------
213# REPLICATION
214#------------------------------------------------------------------------------
215
216# - Sending Server(s) -
217
218# Set these on the master and on any standby that will send replication data.
219
220#max_wal_senders = 0 # max number of walsender processes
221 # (change requires restart)
222#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
223#wal_sender_timeout = 60s # in milliseconds; 0 disables
224
225#max_replication_slots = 0 # max number of replication slots
226 # (change requires restart)
227
228# - Master Server -
229
230# These settings are ignored on a standby server.
231
232#synchronous_standby_names = '' # standby servers that provide sync rep
233 # comma-separated list of application_name
234 # from standby(s); '*' = all
235#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
236
237# - Standby Servers -
238
239# These settings are ignored on a master server.
240
241#hot_standby = off # "on" allows queries during recovery
242 # (change requires restart)
243#max_standby_archive_delay = 30s # max delay before canceling queries
244 # when reading WAL from archive;
245 # -1 allows indefinite delay
246#max_standby_streaming_delay = 30s # max delay before canceling queries
247 # when reading streaming WAL;
248 # -1 allows indefinite delay
249#wal_receiver_status_interval = 10s # send replies at least this often
250 # 0 disables
251#hot_standby_feedback = off # send info from standby to prevent
252 # query conflicts
253#wal_receiver_timeout = 60s # time that receiver waits for
254 # communication from master
255 # in milliseconds; 0 disables
256
257
258#------------------------------------------------------------------------------
259# QUERY TUNING
260#------------------------------------------------------------------------------
261
262# - Planner Method Configuration -
263
264#enable_bitmapscan = on
265#enable_hashagg = on
266#enable_hashjoin = on
267#enable_indexscan = on
268#enable_indexonlyscan = on
269#enable_material = on
270#enable_mergejoin = on
271#enable_nestloop = on
272#enable_seqscan = on
273#enable_sort = on
274#enable_tidscan = on
275
276# - Planner Cost Constants -
277
278#seq_page_cost = 1.0 # measured on an arbitrary scale
279#random_page_cost = 4.0 # same scale as above
280#cpu_tuple_cost = 0.01 # same scale as above
281#cpu_index_tuple_cost = 0.005 # same scale as above
282#cpu_operator_cost = 0.0025 # same scale as above
283#effective_cache_size = 6GB
284effective_cache_size = 128MB
285
286# - Genetic Query Optimizer -
287
288#geqo = on
289#geqo_threshold = 12
290#geqo_effort = 5 # range 1-10
291#geqo_pool_size = 0 # selects default based on effort
292#geqo_generations = 0 # selects default based on effort
293#geqo_selection_bias = 2.0 # range 1.5-2.0
294#geqo_seed = 0.0 # range 0.0-1.0
295
296# - Other Planner Options -
297
298default_statistics_target = 100 # range 1-10000
299#constraint_exclusion = partition # on, off, or partition
300#cursor_tuple_fraction = 0.1 # range 0.0-1.0
301#from_collapse_limit = 8
302#join_collapse_limit = 8 # 1 disables collapsing of explicit
303 # JOIN clauses
304
305
306#------------------------------------------------------------------------------
307# ERROR REPORTING AND LOGGING
308#------------------------------------------------------------------------------
309
310# - Where to Log -
311
312#log_destination = 'stderr' # Valid values are combinations of
313 # stderr, csvlog, syslog, and eventlog,
314 # depending on platform. csvlog
315 # requires logging_collector to be on.
316
317# This is used when logging to stderr:
318#logging_collector = off # Enable capturing of stderr and csvlog
319 # into log files. Required to be on for
320 # csvlogs.
321 # (change requires restart)
322
323# These are only used if logging_collector is on:
324#log_directory = 'pg_log' # directory where log files are written,
325 # can be absolute or relative to PGDATA
326#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
327 # can include strftime() escapes
328#log_file_mode = 0600 # creation mode for log files,
329 # begin with 0 to use octal notation
330#log_truncate_on_rotation = off # If on, an existing log file with the
331 # same name as the new log file will be
332 # truncated rather than appended to.
333 # But such truncation only occurs on
334 # time-driven rotation, not on restarts
335 # or size-driven rotation. Default is
336 # off, meaning append to existing files
337 # in all cases.
338#log_rotation_age = 1d # Automatic rotation of logfiles will
339 # happen after that time. 0 disables.
340#log_rotation_size = 10MB # Automatic rotation of logfiles will
341 # happen after that much log output.
342 # 0 disables.
343
344# These are relevant when logging to syslog:
345#syslog_facility = 'LOCAL0'
346#syslog_ident = 'postgres'
347
348# This is only relevant when logging to eventlog (win32):
349#event_source = 'PostgreSQL'
350
351# - When to Log -
352
353#client_min_messages = notice # values in order of decreasing detail:
354 # debug5
355 # debug4
356 # debug3
357 # debug2
358 # debug1
359 # log
360 # notice
361 # warning
362 # error
363
364#log_min_messages = warning # values in order of decreasing detail:
365 # debug5
366 # debug4
367 # debug3
368 # debug2
369 # debug1
370 # info
371 # notice
372 # warning
373 # error
374 # log
375 # fatal
376 # panic
377
378#log_min_error_statement = error # values in order of decreasing detail:
379 # debug5
380 # debug4
381 # debug3
382 # debug2
383 # debug1
384 # info
385 # notice
386 # warning
387 # error
388 # log
389 # fatal
390 # panic (effectively off)
391
392#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
393 # and their durations, > 0 logs only
394 # statements running at least this number
395 # of milliseconds
396
397
398# - What to Log -
399
400#debug_print_parse = off
401#debug_print_rewritten = off
402#debug_print_plan = off
403#debug_pretty_print = on
404#log_checkpoints = off
405#log_connections = off
406#log_disconnections = off
407#log_duration = off
408#log_error_verbosity = default # terse, default, or verbose messages
409#log_hostname = off
410log_line_prefix = '%t [%p-%l] %q%u@%d ' # special values:
411 # %a = application name
412 # %u = user name
413 # %d = database name
414 # %r = remote host and port
415 # %h = remote host
416 # %p = process ID
417 # %t = timestamp without milliseconds
418 # %m = timestamp with milliseconds
419 # %i = command tag
420 # %e = SQL state
421 # %c = session ID
422 # %l = session line number
423 # %s = session start timestamp
424 # %v = virtual transaction ID
425 # %x = transaction ID (0 if none)
426 # %q = stop here in non-session
427 # processes
428 # %% = '%'
429 # e.g. '<%u%%%d> '
430#log_lock_waits = off # log lock waits >= deadlock_timeout
431#log_statement = 'none' # none, ddl, mod, all
432#log_temp_files = -1 # log temporary files equal or larger
433 # than the specified size in kilobytes;
434 # -1 disables, 0 logs all temp files
435log_timezone = 'Poland'
436
437
438#------------------------------------------------------------------------------
439# RUNTIME STATISTICS
440#------------------------------------------------------------------------------
441
442# - Query/Index Statistics Collector -
443
444#track_activities = on
445#track_counts = on
446#track_io_timing = off
447#track_functions = none # none, pl, all
448#track_activity_query_size = 1024 # (change requires restart)
449#update_process_title = on
450stats_temp_directory = '/var/run/postgresql/9.4-main.pg_stat_tmp'
451
452
453# - Statistics Monitoring -
454
455#log_parser_stats = off
456#log_planner_stats = off
457#log_executor_stats = off
458#log_statement_stats = off
459
460
461#------------------------------------------------------------------------------
462# AUTOVACUUM PARAMETERS
463#------------------------------------------------------------------------------
464
465#autovacuum = on # Enable autovacuum subprocess? 'on'
466 # requires track_counts to also be on.
467#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
468 # their durations, > 0 logs only
469 # actions running at least this number
470 # of milliseconds.
471#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
472 # (change requires restart)
473#autovacuum_naptime = 1min # time between autovacuum runs
474#autovacuum_vacuum_threshold = 50 # min number of row updates before
475 # vacuum
476#autovacuum_analyze_threshold = 50 # min number of row updates before
477 # analyze
478#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
479#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
480#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
481 # (change requires restart)
482#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
483 # before forced vacuum
484 # (change requires restart)
485#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
486 # autovacuum, in milliseconds;
487 # -1 means use vacuum_cost_delay
488#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
489 # autovacuum, -1 means use
490 # vacuum_cost_limit
491
492
493#------------------------------------------------------------------------------
494# CLIENT CONNECTION DEFAULTS
495#------------------------------------------------------------------------------
496
497# - Statement Behavior -
498
499#search_path = '"$user",public' # schema names
500#default_tablespace = '' # a tablespace name, '' uses the default
501#temp_tablespaces = '' # a list of tablespace names, '' uses
502 # only default tablespace
503#check_function_bodies = on
504#default_transaction_isolation = 'read committed'
505#default_transaction_read_only = off
506#default_transaction_deferrable = off
507#session_replication_role = 'origin'
508#statement_timeout = 0 # in milliseconds, 0 is disabled
509#lock_timeout = 0 # in milliseconds, 0 is disabled
510#vacuum_freeze_min_age = 50000000
511#vacuum_freeze_table_age = 150000000
512#vacuum_multixact_freeze_min_age = 5000000
513#vacuum_multixact_freeze_table_age = 150000000
514#bytea_output = 'hex' # hex, escape
515#xmlbinary = 'base64'
516#xmloption = 'content'
517#gin_fuzzy_search_limit = 0
518
519# - Locale and Formatting -
520
521datestyle = 'iso, dmy'
522#intervalstyle = 'postgres'
523timezone = 'Poland'
524#timezone_abbreviations = 'Default' # Select the set of available time zone
525 # abbreviations. Currently, there are
526 # Default
527 # Australia (historical usage)
528 # India
529 # You can create your own file in
530 # share/timezonesets/.
531#extra_float_digits = 0 # min -15, max 3
532#client_encoding = sql_ascii # actually, defaults to database
533 # encoding
534
535# These settings are initialized by initdb, but they can be changed.
536lc_messages = 'pl_PL.UTF-8' # locale for system error message
537 # strings
538lc_monetary = 'pl_PL.UTF-8' # locale for monetary formatting
539lc_numeric = 'pl_PL.UTF-8' # locale for number formatting
540lc_time = 'pl_PL.UTF-8' # locale for time formatting
541
542# default configuration for text search
543default_text_search_config = 'pg_catalog.simple'
544
545# - Other Defaults -
546
547#dynamic_library_path = '$libdir'
548#local_preload_libraries = ''
549#session_preload_libraries = ''
550
551
552#------------------------------------------------------------------------------
553# LOCK MANAGEMENT
554#------------------------------------------------------------------------------
555
556#deadlock_timeout = 1s
557#max_locks_per_transaction = 64 # min 10
558 # (change requires restart)
559#max_pred_locks_per_transaction = 64 # min 10
560 # (change requires restart)
561
562
563#------------------------------------------------------------------------------
564# VERSION/PLATFORM COMPATIBILITY
565#------------------------------------------------------------------------------
566
567# - Previous PostgreSQL Versions -
568
569#array_nulls = on
570#backslash_quote = safe_encoding # on, off, or safe_encoding
571#default_with_oids = off
572#escape_string_warning = on
573#lo_compat_privileges = off
574#quote_all_identifiers = off
575#sql_inheritance = on
576#standard_conforming_strings = on
577#synchronize_seqscans = on
578
579# - Other Platforms and Clients -
580
581#transform_null_equals = off
582
583
584#------------------------------------------------------------------------------
585# ERROR HANDLING
586#------------------------------------------------------------------------------
587
588#exit_on_error = off # terminate session on any error?
589#restart_after_crash = on # reinitialize after backend crash?
590
591
592#------------------------------------------------------------------------------
593# CONFIG FILE INCLUDES
594#------------------------------------------------------------------------------
595
596# These options allow settings to be loaded from files other than the
597# default postgresql.conf.
598
599#include_dir = 'conf.d' # include files ending in '.conf' from
600 # directory 'conf.d'
601#include_if_exists = 'exists.conf' # include file only if it exists
602#include = 'special.conf' # include file
603
604
605#------------------------------------------------------------------------------
606# CUSTOMIZED OPTIONS
607#------------------------------------------------------------------------------
608
609# Add settings for extensions here