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