· 6 years ago · Mar 15, 2019, 07:44 AM
1#------------------------------------------------------------------------------
2# FILE LOCATIONS
3#------------------------------------------------------------------------------
4
5# The default values of these variables are driven from the -D command-line
6# option or PGDATA environment variable, represented here as ConfigDir.
7
8#data_directory = '/var/lib/postgresql/10/main' # use data in another directory
9data_directory = '/usr/share/apps/10/main'
10 # (change requires restart)
11hba_file = '/etc/postgresql/10/main/pg_hba.conf' # host-based authentication file
12 # (change requires restart)
13ident_file = '/etc/postgresql/10/main/pg_ident.conf' # ident configuration file
14 # (change requires restart)
15
16# If external_pid_file is not explicitly set, no extra PID file is written.
17external_pid_file = '/var/run/postgresql/10-main.pid' # write an extra PID file
18 # (change requires restart)
19
20#------------------------------------------------------------------------------
21# CONNECTIONS AND AUTHENTICATION
22#------------------------------------------------------------------------------
23
24# - Connection Settings -
25
26#listen_addresses = 'localhost' # what IP address(es) to listen on;
27 # comma-separated list of addresses;
28 # defaults to 'localhost'; use '*' for all
29 # (change requires restart)
30port = 5432 # (change requires restart)
31max_connections = 100 # (change requires restart)
32#superuser_reserved_connections = 3 # (change requires restart)
33unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
34 # (change requires restart)
35#unix_socket_group = '' # (change requires restart)
36#unix_socket_permissions = 0777 # begin with 0 to use octal notation
37 # (change requires restart)
38#bonjour = off # advertise server via Bonjour
39 # (change requires restart)
40#bonjour_name = '' # defaults to the computer name
41 # (change requires restart)
42
43# - Security and Authentication -
44
45#authentication_timeout = 1min # 1s-600s
46ssl = on
47#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
48#ssl_prefer_server_ciphers = on
49#ssl_ecdh_curve = 'prime256v1'
50#ssl_dh_params_file = ''
51ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
52ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'
53#ssl_ca_file = ''
54#ssl_crl_file = ''
55#password_encryption = md5 # md5 or scram-sha-256
56#db_user_namespace = off
57#row_security = on
58
59# GSSAPI using Kerberos
60#krb_server_keyfile = ''
61#krb_caseins_users = off
62
63# - TCP Keepalives -
64# see "man 7 tcp" for details
65#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
66 # 0 selects the system default
67#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
68 # 0 selects the system default
69#tcp_keepalives_count = 0 # TCP_KEEPCNT;
70 # 0 selects the system default
71
72
73#------------------------------------------------------------------------------
74# RESOURCE USAGE (except WAL)
75#------------------------------------------------------------------------------
76
77# - Memory -
78
79shared_buffers = 128MB # min 128kB
80 # (change requires restart)
81#huge_pages = try # on, off, or try
82 # (change requires restart)
83#temp_buffers = 8MB # min 800kB
84#max_prepared_transactions = 0 # zero disables the feature
85 # (change requires restart)
86# Caution: it is not advisable to set max_prepared_transactions nonzero unless
87# you actively intend to use prepared transactions.
88#work_mem = 4MB # min 64kB
89#maintenance_work_mem = 64MB # min 1MB
90#replacement_sort_tuples = 150000 # limits use of replacement selection sort
91#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
92#max_stack_depth = 2MB # min 100kB
93dynamic_shared_memory_type = posix # the default is the first option
94 # supported by the operating system:
95 # posix
96 # sysv
97 # windows
98 # mmap
99 # use none to disable dynamic shared memory
100 # (change requires restart)
101
102# - Disk -
103
104#temp_file_limit = -1 # limits per-process temp file space
105 # in kB, or -1 for no limit
106
107# - Kernel Resource Usage -
108
109#max_files_per_process = 1000 # min 25
110 # (change requires restart)
111#shared_preload_libraries = '' # (change requires restart)
112
113# - Cost-Based Vacuum Delay -
114
115#vacuum_cost_delay = 0 # 0-100 milliseconds
116#vacuum_cost_page_hit = 1 # 0-10000 credits
117#vacuum_cost_page_miss = 10 # 0-10000 credits
118#vacuum_cost_page_dirty = 20 # 0-10000 credits
119#vacuum_cost_limit = 200 # 1-10000 credits
120
121# - Background Writer -
122
123#bgwriter_delay = 200ms # 10-10000ms between rounds
124#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
125#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round
126#bgwriter_flush_after = 512kB # measured in pages, 0 disables
127
128# - Asynchronous Behavior -
129
130#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching
131#max_worker_processes = 8 # (change requires restart)
132#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers
133#max_parallel_workers = 8 # maximum number of max_worker_processes that
134 # can be used in parallel queries
135#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate
136 # (change requires restart)
137#backend_flush_after = 0 # measured in pages, 0 disables
138
139#------------------------------------------------------------------------------
140# WRITE AHEAD LOG
141#------------------------------------------------------------------------------
142
143# - Settings -
144
145#wal_level = replica # minimal, replica, or logical
146 # (change requires restart)
147#fsync = on # flush data to disk for crash safety
148 # (turning this off can cause
149 # unrecoverable data corruption)
150#synchronous_commit = on # synchronization level;
151 # off, local, remote_write, remote_apply, or on
152#wal_sync_method = fsync # the default is the first option
153 # supported by the operating system:
154 # open_datasync
155 # fdatasync (default on Linux)
156 # fsync
157 # fsync_writethrough
158 # open_sync
159#full_page_writes = on # recover from partial page writes
160#wal_compression = off # enable compression of full-page writes
161#wal_log_hints = off # also do full page writes of non-critical updates
162 # (change requires restart)
163#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
164 # (change requires restart)
165#wal_writer_delay = 200ms # 1-10000 milliseconds
166#wal_writer_flush_after = 1MB # measured in pages, 0 disables
167
168#commit_delay = 0 # range 0-100000, in microseconds
169#commit_siblings = 5 # range 1-1000
170
171# - Checkpoints -
172
173#checkpoint_timeout = 5min # range 30s-1d
174#max_wal_size = 1GB
175#min_wal_size = 80MB
176#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
177#checkpoint_flush_after = 256kB # measured in pages, 0 disables
178#checkpoint_warning = 30s # 0 disables
179
180# - Archiving -
181
182#archive_mode = off # enables archiving; off, on, or always
183 # (change requires restart)
184#archive_command = '' # command to use to archive a logfile segment
185 # placeholders: %p = path of file to archive
186 # %f = file name only
187 # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
188#archive_timeout = 0 # force a logfile segment switch after this
189 # number of seconds; 0 disables
190
191
192#------------------------------------------------------------------------------
193# REPLICATION
194#------------------------------------------------------------------------------
195
196# - Sending Server(s) -
197
198# Set these on the master and on any standby that will send replication data.
199
200#max_wal_senders = 10 # max number of walsender processes
201 # (change requires restart)
202#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
203#wal_sender_timeout = 60s # in milliseconds; 0 disables
204
205#max_replication_slots = 10 # max number of replication slots
206 # (change requires restart)
207#track_commit_timestamp = off # collect timestamp of transaction commit
208 # (change requires restart)
209
210# - Master Server -
211
212# These settings are ignored on a standby server.
213
214#synchronous_standby_names = '' # standby servers that provide sync rep
215 # method to choose sync standbys, number of sync standbys,
216 # and comma-separated list of application_name
217 # from standby(s); '*' = all
218#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
219
220# - Standby Servers -
221
222# These settings are ignored on a master server.
223
224#hot_standby = on # "off" disallows queries during recovery
225 # (change requires restart)
226#max_standby_archive_delay = 30s # max delay before canceling queries
227 # when reading WAL from archive;
228 # -1 allows indefinite delay
229#max_standby_streaming_delay = 30s # max delay before canceling queries
230 # when reading streaming WAL;
231 # -1 allows indefinite delay
232#wal_receiver_status_interval = 10s # send replies at least this often
233 # 0 disables
234#hot_standby_feedback = off # send info from standby to prevent
235 # query conflicts
236#wal_receiver_timeout = 60s # time that receiver waits for
237 # communication from master
238 # in milliseconds; 0 disables
239#wal_retrieve_retry_interval = 5s # time to wait before retrying to
240 # retrieve WAL after a failed attempt
241
242# - Subscribers -
243
244# These settings are ignored on a publisher.
245
246#max_logical_replication_workers = 4 # taken from max_worker_processes
247 # (change requires restart)
248#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers
249
250
251#------------------------------------------------------------------------------
252# QUERY TUNING
253#------------------------------------------------------------------------------
254
255# - Planner Method Configuration -
256
257#enable_bitmapscan = on
258#enable_hashagg = on
259#enable_hashjoin = on
260#enable_indexscan = on
261#enable_indexonlyscan = on
262#enable_material = on
263#enable_mergejoin = on
264#enable_nestloop = on
265#enable_seqscan = on
266#enable_sort = on
267#enable_tidscan = on
268
269# - Planner Cost Constants -
270
271#seq_page_cost = 1.0 # measured on an arbitrary scale
272#random_page_cost = 4.0 # same scale as above
273#cpu_tuple_cost = 0.01 # same scale as above
274#cpu_index_tuple_cost = 0.005 # same scale as above
275#cpu_operator_cost = 0.0025 # same scale as above
276#parallel_tuple_cost = 0.1 # same scale as above
277#parallel_setup_cost = 1000.0 # same scale as above
278#min_parallel_table_scan_size = 8MB
279#min_parallel_index_scan_size = 512kB
280#effective_cache_size = 4GB
281
282# - Genetic Query Optimizer -
283
284#geqo = on
285#geqo_threshold = 12
286#geqo_effort = 5 # range 1-10
287#geqo_pool_size = 0 # selects default based on effort
288#geqo_generations = 0 # selects default based on effort
289#geqo_selection_bias = 2.0 # range 1.5-2.0
290#geqo_seed = 0.0 # range 0.0-1.0
291
292# - Other Planner Options -
293
294#default_statistics_target = 100 # range 1-10000
295#constraint_exclusion = partition # on, off, or partition
296#cursor_tuple_fraction = 0.1 # range 0.0-1.0
297#from_collapse_limit = 8
298#join_collapse_limit = 8 # 1 disables collapsing of explicit
299 # JOIN clauses
300#force_parallel_mode = off
301
302
303#------------------------------------------------------------------------------
304# ERROR REPORTING AND LOGGING
305#------------------------------------------------------------------------------
306
307# - Where to Log -
308
309#log_destination = 'stderr' # Valid values are combinations of
310 # stderr, csvlog, syslog, and eventlog,
311 # depending on platform. csvlog
312 # requires logging_collector to be on.
313
314# This is used when logging to stderr:
315#logging_collector = off # Enable capturing of stderr and csvlog
316 # into log files. Required to be on for
317 # csvlogs.
318 # (change requires restart)
319
320# These are only used if logging_collector is on:
321#log_directory = 'log' # directory where log files are written,
322 # can be absolute or relative to PGDATA
323#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
324 # can include strftime() escapes
325#log_file_mode = 0600 # creation mode for log files,
326 # begin with 0 to use octal notation
327#log_truncate_on_rotation = off # If on, an existing log file with the
328 # same name as the new log file will be
329 # truncated rather than appended to.
330 # But such truncation only occurs on
331 # time-driven rotation, not on restarts
332 # or size-driven rotation. Default is
333 # off, meaning append to existing files
334 # in all cases.
335#log_rotation_age = 1d # Automatic rotation of logfiles will
336 # happen after that time. 0 disables.
337#log_rotation_size = 10MB # Automatic rotation of logfiles will
338 # happen after that much log output.
339 # 0 disables.
340
341# These are relevant when logging to syslog:
342#syslog_facility = 'LOCAL0'
343#syslog_ident = 'postgres'
344#syslog_sequence_numbers = on
345#syslog_split_messages = on
346
347# This is only relevant when logging to eventlog (win32):
348# (change requires restart)
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 = '%m [%p] %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 # %n = timestamp with milliseconds (as a Unix epoch)
420 # %i = command tag
421 # %e = SQL state
422 # %c = session ID
423 # %l = session line number
424 # %s = session start timestamp
425 # %v = virtual transaction ID
426 # %x = transaction ID (0 if none)
427 # %q = stop here in non-session
428 # processes
429 # %% = '%'
430 # e.g. '<%u%%%d> '
431#log_lock_waits = off # log lock waits >= deadlock_timeout
432#log_statement = 'none' # none, ddl, mod, all
433#log_replication_commands = off
434#log_temp_files = -1 # log temporary files equal or larger
435 # than the specified size in kilobytes;
436 # -1 disables, 0 logs all temp files
437log_timezone = 'localtime'
438
439
440# - Process Title -
441
442cluster_name = '10/main' # added to process titles if nonempty
443 # (change requires restart)
444#update_process_title = on
445
446
447#------------------------------------------------------------------------------
448# RUNTIME STATISTICS
449#------------------------------------------------------------------------------
450
451# - Query/Index Statistics Collector -
452
453#track_activities = on
454#track_counts = on
455#track_io_timing = off
456#track_functions = none # none, pl, all
457#track_activity_query_size = 1024 # (change requires restart)
458stats_temp_directory = '/var/run/postgresql/10-main.pg_stat_tmp'
459
460
461# - Statistics Monitoring -
462
463#log_parser_stats = off
464#log_planner_stats = off
465#log_executor_stats = off
466#log_statement_stats = off
467
468
469#------------------------------------------------------------------------------
470# AUTOVACUUM PARAMETERS
471#------------------------------------------------------------------------------
472
473#autovacuum = on # Enable autovacuum subprocess? 'on'
474 # requires track_counts to also be on.
475#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
476 # their durations, > 0 logs only
477 # actions running at least this number
478 # of milliseconds.
479#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
480 # (change requires restart)
481#autovacuum_naptime = 1min # time between autovacuum runs
482#autovacuum_vacuum_threshold = 50 # min number of row updates before
483 # vacuum
484#autovacuum_analyze_threshold = 50 # min number of row updates before
485 # analyze
486#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
487#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
488#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
489 # (change requires restart)
490#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
491 # before forced vacuum
492 # (change requires restart)
493#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
494 # autovacuum, in milliseconds;
495 # -1 means use vacuum_cost_delay
496#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
497 # autovacuum, -1 means use
498 # vacuum_cost_limit
499
500
501#------------------------------------------------------------------------------
502# CLIENT CONNECTION DEFAULTS
503#------------------------------------------------------------------------------
504
505# - Statement Behavior -
506
507#search_path = '"$user", public' # schema names
508#default_tablespace = '' # a tablespace name, '' uses the default
509#temp_tablespaces = '' # a list of tablespace names, '' uses
510 # only default tablespace
511#check_function_bodies = on
512#default_transaction_isolation = 'read committed'
513#default_transaction_read_only = off
514#default_transaction_deferrable = off
515#session_replication_role = 'origin'
516#statement_timeout = 0 # in milliseconds, 0 is disabled
517#lock_timeout = 0 # in milliseconds, 0 is disabled
518#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled
519#vacuum_freeze_min_age = 50000000
520#vacuum_freeze_table_age = 150000000
521#vacuum_multixact_freeze_min_age = 5000000
522#vacuum_multixact_freeze_table_age = 150000000
523#bytea_output = 'hex' # hex, escape
524#xmlbinary = 'base64'
525#xmloption = 'content'
526#gin_fuzzy_search_limit = 0
527#gin_pending_list_limit = 4MB
528
529# - Locale and Formatting -
530
531datestyle = 'iso, mdy'
532#intervalstyle = 'postgres'
533timezone = 'localtime'
534#timezone_abbreviations = 'Default' # Select the set of available time zone
535 # abbreviations. Currently, there are
536 # Default
537 # Australia (historical usage)
538 # India
539 # You can create your own file in
540 # share/timezonesets/.
541#extra_float_digits = 0 # min -15, max 3
542#client_encoding = sql_ascii # actually, defaults to database
543 # encoding
544
545# These settings are initialized by initdb, but they can be changed.
546lc_messages = 'C.UTF-8' # locale for system error message
547 # strings
548lc_monetary = 'C.UTF-8' # locale for monetary formatting
549lc_numeric = 'C.UTF-8' # locale for number formatting
550lc_time = 'C.UTF-8' # locale for time formatting
551
552# default configuration for text search
553default_text_search_config = 'pg_catalog.english'
554
555# - Other Defaults -
556
557#dynamic_library_path = '$libdir'
558#local_preload_libraries = ''
559#session_preload_libraries = ''
560
561
562#------------------------------------------------------------------------------
563# LOCK MANAGEMENT
564#------------------------------------------------------------------------------
565
566#deadlock_timeout = 1s
567#max_locks_per_transaction = 64 # min 10
568 # (change requires restart)
569#max_pred_locks_per_transaction = 64 # min 10
570 # (change requires restart)
571#max_pred_locks_per_relation = -2 # negative values mean
572 # (max_pred_locks_per_transaction
573 # / -max_pred_locks_per_relation) - 1
574#max_pred_locks_per_page = 2 # min 0
575
576
577#------------------------------------------------------------------------------
578# VERSION/PLATFORM COMPATIBILITY
579#------------------------------------------------------------------------------
580
581# - Previous PostgreSQL Versions -
582
583#array_nulls = on
584#backslash_quote = safe_encoding # on, off, or safe_encoding
585#default_with_oids = off
586#escape_string_warning = on
587#lo_compat_privileges = off
588#operator_precedence_warning = off
589#quote_all_identifiers = off
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
613include_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