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