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