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