Project

General

Profile

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

    
41
data_directory = '/var/lib/postgresql/9.3/main'		# use data in another directory
42
					# (change requires restart)
43
hba_file = '/etc/postgresql/9.3/main/pg_hba.conf'	# host-based authentication file
44
					# (change requires restart)
45
ident_file = '/etc/postgresql/9.3/main/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 = '/var/run/postgresql/9.3-main.pid'			# 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 = '*'		# what IP address(es) to listen on;
60
#listen_addresses = 'localhost'		# what IP address(es) to listen on;
61
					# comma-separated list of addresses;
62
					# defaults to 'localhost'; use '*' for all
63
					# (change requires restart)
64
port = 5432				# (change requires restart)
65
max_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 = '/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 = true				# (change requires restart)
83
#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH'	# allowed SSL ciphers
84
					# (change requires restart)
85
#ssl_renegotiation_limit = 512MB	# amount of data between renegotiations
86
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'		# (change requires restart)
87
ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'		# (change requires restart)
88
#ssl_ca_file = ''			# (change requires restart)
89
#ssl_crl_file = ''			# (change requires restart)
90
#password_encryption = on
91
#db_user_namespace = off
92

    
93
# Kerberos and GSSAPI
94
#krb_server_keyfile = ''
95
#krb_srvname = 'postgres'		# (Kerberos only)
96
#krb_caseins_users = off
97

    
98
# - TCP Keepalives -
99
# see "man 7 tcp" for details
100

    
101
#tcp_keepalives_idle = 0		# TCP_KEEPIDLE, in seconds;
102
					# 0 selects the system default
103
#tcp_keepalives_interval = 0		# TCP_KEEPINTVL, in seconds;
104
					# 0 selects the system default
105
#tcp_keepalives_count = 0		# TCP_KEEPCNT;
106
					# 0 selects the system default
107

    
108

    
109
#------------------------------------------------------------------------------
110
# RESOURCE USAGE (except WAL)
111
#------------------------------------------------------------------------------
112

    
113
# - Memory -
114

    
115
# Must be less than total memory and less than ~95% of SHMMAX
116
# 32-bit Linux (e.g. Ubuntu VM) may support less:
117
# http://www.postgresql.org/message-id/27470.1323837026@sss.pgh.pa.us
118
shared_buffers = 2700MB			# min 128kB
119
#shared_buffers = 128MB			# min 128kB
120
					# (change requires restart)
121
#temp_buffers = 8MB			# min 800kB
122
#max_prepared_transactions = 0		# zero disables the feature
123
					# (change requires restart)
124
# Note:  Increasing max_prepared_transactions costs ~600 bytes of shared memory
125
# per transaction slot, plus lock space (see max_locks_per_transaction).
126
# It is not advisable to set max_prepared_transactions nonzero unless you
127
# actively intend to use prepared transactions.
128
# this is *multiplied* by max_connections
129
# i.e. 256 MB * 100 = *26 GB*, which approaches total memory (32 GB)
130
work_mem = 256MB				# min 64kB
131
#work_mem = 1MB				# min 64kB
132
maintenance_work_mem = 256MB		# min 1MB
133
#maintenance_work_mem = 16MB		# min 1MB
134
#max_stack_depth = 2MB			# min 100kB
135

    
136
# - Disk -
137

    
138
#temp_file_limit = -1			# limits per-session temp file space
139
					# in kB, or -1 for no limit
140

    
141
# - Kernel Resource Usage -
142

    
143
#max_files_per_process = 1000		# min 25
144
					# (change requires restart)
145
#shared_preload_libraries = ''		# (change requires restart)
146

    
147
# - Cost-Based Vacuum Delay -
148

    
149
#vacuum_cost_delay = 0			# 0-100 milliseconds
150
#vacuum_cost_page_hit = 1		# 0-10000 credits
151
#vacuum_cost_page_miss = 10		# 0-10000 credits
152
#vacuum_cost_page_dirty = 20		# 0-10000 credits
153
#vacuum_cost_limit = 200		# 1-10000 credits
154

    
155
# - Background Writer -
156

    
157
#bgwriter_delay = 200ms			# 10-10000ms between rounds
158
#bgwriter_lru_maxpages = 100		# 0-1000 max buffers written/round
159
#bgwriter_lru_multiplier = 2.0		# 0-10.0 multipler on buffers scanned/round
160

    
161
# - Asynchronous Behavior -
162

    
163
#effective_io_concurrency = 1		# 1-1000; 0 disables prefetching
164

    
165

    
166
#------------------------------------------------------------------------------
167
# WRITE AHEAD LOG
168
#------------------------------------------------------------------------------
169

    
170
# - Settings -
171

    
172
# enable online backup w/ pg_start_backup()
173
wal_level = hot_standby			# minimal, archive, or hot_standby
174
#wal_level = minimal			# minimal, archive, or hot_standby
175
					# (change requires restart)
176
#fsync = on				# turns forced synchronization on or off
177
##### WARNING: Switching this off may cause data loss.
178
# It is used to improve performance with frequent commits. Each datasource makes
179
# ~10 commits/sec (which will hopefully increase after optimization), and there
180
# can be 10+ datasources running simultaneously, so the 100 commit/sec limit may
181
# be exceeded. See synchronous_commit at
182
# <http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server#synchronous_commit>
183
#####
184
synchronous_commit = off		# immediate fsync at commit
185
#synchronous_commit = on		# synchronization level;
186
					# off, local, remote_write, or on
187
#wal_sync_method = fsync		# the default is the first option
188
					# supported by the operating system:
189
					#   open_datasync
190
					#   fdatasync (default on Linux)
191
					#   fsync
192
					#   fsync_writethrough
193
					#   open_sync
194
#full_page_writes = on			# recover from partial page writes
195
#wal_buffers = -1			# min 32kB, -1 sets based on shared_buffers
196
					# (change requires restart)
197
#wal_writer_delay = 200ms		# 1-10000 milliseconds
198

    
199
#commit_delay = 0			# range 0-100000, in microseconds
200
#commit_siblings = 5			# range 1-1000
201

    
202
# - Checkpoints -
203

    
204
checkpoint_segments = 32		# in logfile segments, min 1, 16MB each
205
#checkpoint_segments = 3		# in logfile segments, min 1, 16MB each
206
#checkpoint_timeout = 5min		# range 30s-1h
207
checkpoint_completion_target = 0.9	# checkpoint target duration, 0.0 - 1.0
208
#checkpoint_completion_target = 0.5	# checkpoint target duration, 0.0 - 1.0
209
#checkpoint_warning = 30s		# 0 disables
210

    
211
# - Archiving -
212

    
213
#archive_mode = off		# allows archiving to be done
214
				# (change requires restart)
215
#archive_command = ''		# command to use to archive a logfile segment
216
				# placeholders: %p = path of file to archive
217
				#               %f = file name only
218
				# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
219
#archive_timeout = 0		# force a logfile segment switch after this
220
				# number of seconds; 0 disables
221

    
222

    
223
#------------------------------------------------------------------------------
224
# REPLICATION
225
#------------------------------------------------------------------------------
226

    
227
# - Sending Server(s) -
228

    
229
# Set these on the master and on any standby that will send replication data.
230

    
231
#max_wal_senders = 0		# max number of walsender processes
232
				# (change requires restart)
233
#wal_keep_segments = 0		# in logfile segments, 16MB each; 0 disables
234
#wal_sender_timeout = 60s	# in milliseconds; 0 disables
235

    
236
# - Master Server -
237

    
238
# These settings are ignored on a standby server.
239

    
240
#synchronous_standby_names = ''	# standby servers that provide sync rep
241
				# comma-separated list of application_name
242
				# from standby(s); '*' = all
243
#vacuum_defer_cleanup_age = 0	# number of xacts by which cleanup is delayed
244

    
245
# - Standby Servers -
246

    
247
# These settings are ignored on a master server.
248

    
249
#hot_standby = off			# "on" allows queries during recovery
250
					# (change requires restart)
251
#max_standby_archive_delay = 30s	# max delay before canceling queries
252
					# when reading WAL from archive;
253
					# -1 allows indefinite delay
254
#max_standby_streaming_delay = 30s	# max delay before canceling queries
255
					# when reading streaming WAL;
256
					# -1 allows indefinite delay
257
#wal_receiver_status_interval = 10s	# send replies at least this often
258
					# 0 disables
259
#hot_standby_feedback = off		# send info from standby to prevent
260
					# query conflicts
261
#wal_receiver_timeout = 60s		# time that receiver waits for
262
					# communication from master
263
					# in milliseconds; 0 disables
264

    
265

    
266
#------------------------------------------------------------------------------
267
# QUERY TUNING
268
#------------------------------------------------------------------------------
269

    
270
# - Planner Method Configuration -
271

    
272
#enable_bitmapscan = on
273
#enable_hashagg = on
274
#enable_hashjoin = on
275
#enable_indexscan = on
276
#enable_indexonlyscan = on
277
#enable_material = on
278
#enable_mergejoin = on
279
#enable_nestloop = on
280
#enable_seqscan = on
281
#enable_sort = on
282
#enable_tidscan = on
283

    
284
# - Planner Cost Constants -
285

    
286
#seq_page_cost = 1.0			# measured on an arbitrary scale
287
#random_page_cost = 4.0			# same scale as above
288
#cpu_tuple_cost = 0.01			# same scale as above
289
#cpu_index_tuple_cost = 0.005		# same scale as above
290
#cpu_operator_cost = 0.0025		# same scale as above
291
effective_cache_size = 12GB
292
#effective_cache_size = 128MB
293

    
294
# - Genetic Query Optimizer -
295

    
296
#geqo = on
297
#geqo_threshold = 12
298
#geqo_effort = 5			# range 1-10
299
#geqo_pool_size = 0			# selects default based on effort
300
#geqo_generations = 0			# selects default based on effort
301
#geqo_selection_bias = 2.0		# range 1.5-2.0
302
#geqo_seed = 0.0			# range 0.0-1.0
303

    
304
# - Other Planner Options -
305

    
306
#default_statistics_target = 100	# range 1-10000
307
#constraint_exclusion = partition	# on, off, or partition
308
#cursor_tuple_fraction = 0.1		# range 0.0-1.0
309
#from_collapse_limit = 8
310
#join_collapse_limit = 8		# 1 disables collapsing of explicit
311
					# JOIN clauses
312

    
313

    
314
#------------------------------------------------------------------------------
315
# ERROR REPORTING AND LOGGING
316
#------------------------------------------------------------------------------
317

    
318
# - Where to Log -
319

    
320
#log_destination = 'stderr'		# Valid values are combinations of
321
					# stderr, csvlog, syslog, and eventlog,
322
					# depending on platform.  csvlog
323
					# requires logging_collector to be on.
324

    
325
# This is used when logging to stderr:
326
logging_collector = on
327
#logging_collector = off		# Enable capturing of stderr and csvlog
328
					# into log files. Required to be on for
329
					# csvlogs.
330
					# (change requires restart)
331

    
332
# These are only used if logging_collector is on:
333
#log_directory = 'pg_log'		# directory where log files are written,
334
					# can be absolute or relative to PGDATA
335
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'	# log file name pattern,
336
					# can include strftime() escapes
337
#log_file_mode = 0600			# creation mode for log files,
338
					# begin with 0 to use octal notation
339
#log_truncate_on_rotation = off		# If on, an existing log file with the
340
					# same name as the new log file will be
341
					# truncated rather than appended to.
342
					# But such truncation only occurs on
343
					# time-driven rotation, not on restarts
344
					# or size-driven rotation.  Default is
345
					# off, meaning append to existing files
346
					# in all cases.
347
#log_rotation_age = 1d			# Automatic rotation of logfiles will
348
					# happen after that time.  0 disables.
349
#log_rotation_size = 10MB		# Automatic rotation of logfiles will
350
					# happen after that much log output.
351
					# 0 disables.
352

    
353
# These are relevant when logging to syslog:
354
#syslog_facility = 'LOCAL0'
355
#syslog_ident = 'postgres'
356

    
357
# This is only relevant when logging to eventlog (win32):
358
#event_source = 'PostgreSQL'
359

    
360
# - When to Log -
361

    
362
#client_min_messages = notice		# values in order of decreasing detail:
363
					#   debug5
364
					#   debug4
365
					#   debug3
366
					#   debug2
367
					#   debug1
368
					#   log
369
					#   notice
370
					#   warning
371
					#   error
372

    
373
#log_min_messages = debug2 # show what autovacuum is doing
374
#log_min_messages = warning		# values in order of decreasing detail:
375
					#   debug5
376
					#   debug4
377
					#   debug3
378
					#   debug2
379
					#   debug1
380
					#   info
381
					#   notice
382
					#   warning
383
					#   error
384
					#   log
385
					#   fatal
386
					#   panic
387

    
388
#log_min_error_statement = error	# values in order of decreasing detail:
389
				 	#   debug5
390
					#   debug4
391
					#   debug3
392
					#   debug2
393
					#   debug1
394
				 	#   info
395
					#   notice
396
					#   warning
397
					#   error
398
					#   log
399
					#   fatal
400
					#   panic (effectively off)
401

    
402
#log_min_duration_statement = -1	# -1 is disabled, 0 logs all statements
403
					# and their durations, > 0 logs only
404
					# statements running at least this number
405
					# of milliseconds
406

    
407

    
408
# - What to Log -
409

    
410
#debug_print_parse = off
411
#debug_print_rewritten = off
412
#debug_print_plan = off
413
#debug_pretty_print = on
414
#log_checkpoints = off
415
#log_connections = off
416
#log_disconnections = off
417
#log_duration = off
418
#log_error_verbosity = default		# terse, default, or verbose messages
419
#log_hostname = off
420
log_line_prefix = '%t '			# special values:
421
					#   %a = application name
422
					#   %u = user name
423
					#   %d = database name
424
					#   %r = remote host and port
425
					#   %h = remote host
426
					#   %p = process ID
427
					#   %t = timestamp without milliseconds
428
					#   %m = timestamp with milliseconds
429
					#   %i = command tag
430
					#   %e = SQL state
431
					#   %c = session ID
432
					#   %l = session line number
433
					#   %s = session start timestamp
434
					#   %v = virtual transaction ID
435
					#   %x = transaction ID (0 if none)
436
					#   %q = stop here in non-session
437
					#        processes
438
					#   %% = '%'
439
					# e.g. '<%u%%%d> '
440
#log_lock_waits = off			# log lock waits >= deadlock_timeout
441
#log_statement = 'none'			# none, ddl, mod, all
442
#log_temp_files = -1			# log temporary files equal or larger
443
					# than the specified size in kilobytes;
444
					# -1 disables, 0 logs all temp files
445
log_timezone = 'localtime'
446

    
447

    
448
#------------------------------------------------------------------------------
449
# RUNTIME STATISTICS
450
#------------------------------------------------------------------------------
451

    
452
# - Query/Index Statistics Collector -
453

    
454
#track_activities = on
455
#track_counts = on
456
#track_io_timing = off
457
#track_functions = none			# none, pl, all
458
#track_activity_query_size = 1024 	# (change requires restart)
459
#update_process_title = on
460
#stats_temp_directory = 'pg_stat_tmp'
461

    
462

    
463
# - Statistics Monitoring -
464

    
465
#log_parser_stats = off
466
#log_planner_stats = off
467
#log_executor_stats = off
468
#log_statement_stats = off
469

    
470

    
471
#------------------------------------------------------------------------------
472
# AUTOVACUUM PARAMETERS
473
#------------------------------------------------------------------------------
474

    
475
#autovacuum = on			# Enable autovacuum subprocess?  'on'
476
					# requires track_counts to also be on.
477
log_autovacuum_min_duration = 0	# -1 disables, 0 logs all actions and
478
#log_autovacuum_min_duration = -1	# -1 disables, 0 logs all actions and
479
					# their durations, > 0 logs only
480
					# actions running at least this number
481
					# of milliseconds.
482
#autovacuum_max_workers = 3		# max number of autovacuum subprocesses
483
					# (change requires restart)
484
#autovacuum_naptime = 1min		# time between autovacuum runs
485
#autovacuum_vacuum_threshold = 50	# min number of row updates before
486
					# vacuum
487
#autovacuum_analyze_threshold = 50	# min number of row updates before
488
					# analyze
489
#autovacuum_vacuum_scale_factor = 0.2	# fraction of table size before vacuum
490
#autovacuum_analyze_scale_factor = 0.1	# fraction of table size before analyze
491
#autovacuum_freeze_max_age = 200000000	# maximum XID age before forced vacuum
492
					# (change requires restart)
493
# never stall autovacuuming due to a concurrent query, as this can prevent
494
# autovacuuming from happening altogether
495
# (http://vegpath.org/links/#PostgreSQL:%20Documentation:%209.3:%20Resource%20Consumption:%2018.4.4.%20Cost-based%20Vacuum%20Delay)
496
autovacuum_vacuum_cost_delay = -1 # use vacuum_cost_delay (=0)
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
#bytea_output = 'hex'			# hex, escape
525
#xmlbinary = 'base64'
526
#xmloption = 'content'
527

    
528
# - Locale and Formatting -
529

    
530
datestyle = 'iso, mdy'
531
#intervalstyle = 'postgres'
532
timezone = 'localtime'
533
#timezone_abbreviations = 'Default'     # Select the set of available time zone
534
					# abbreviations.  Currently, there are
535
					#   Default
536
					#   Australia
537
					#   India
538
					# You can create your own file in
539
					# share/timezonesets/.
540
#extra_float_digits = 0			# min -15, max 3
541
#client_encoding = sql_ascii		# actually, defaults to database
542
					# encoding
543

    
544
# These settings are initialized by initdb, but they can be changed.
545
lc_messages = 'en_US.UTF-8'			# locale for system error message
546
					# strings
547
lc_monetary = 'en_US.UTF-8'			# locale for monetary formatting
548
lc_numeric = 'en_US.UTF-8'			# locale for number formatting
549
lc_time = 'en_US.UTF-8'				# locale for time formatting
550

    
551
# default configuration for text search
552
default_text_search_config = 'pg_catalog.english'
553

    
554
# - Other Defaults -
555

    
556
#dynamic_library_path = '$libdir'
557
#local_preload_libraries = ''
558

    
559

    
560
#------------------------------------------------------------------------------
561
# LOCK MANAGEMENT
562
#------------------------------------------------------------------------------
563

    
564
#deadlock_timeout = 1s
565
#max_locks_per_transaction = 64		# min 10
566
					# (change requires restart)
567
# Note:  Each lock table slot uses ~270 bytes of shared memory, and there are
568
# max_locks_per_transaction * (max_connections + max_prepared_transactions)
569
# lock table slots.
570
#max_pred_locks_per_transaction = 64	# min 10
571
					# (change requires restart)
572

    
573

    
574
#------------------------------------------------------------------------------
575
# VERSION/PLATFORM COMPATIBILITY
576
#------------------------------------------------------------------------------
577

    
578
# - Previous PostgreSQL Versions -
579

    
580
#array_nulls = on
581
#backslash_quote = safe_encoding	# on, off, or safe_encoding
582
#default_with_oids = off
583
#escape_string_warning = on
584
#lo_compat_privileges = off
585
#quote_all_identifiers = off
586
#sql_inheritance = on
587
#standard_conforming_strings = on
588
#synchronize_seqscans = on
589

    
590
# - Other Platforms and Clients -
591

    
592
#transform_null_equals = off
593

    
594

    
595
#------------------------------------------------------------------------------
596
# ERROR HANDLING
597
#------------------------------------------------------------------------------
598

    
599
#exit_on_error = off			# terminate session on any error?
600
#restart_after_crash = on		# reinitialize after backend crash?
601

    
602

    
603
#------------------------------------------------------------------------------
604
# CONFIG FILE INCLUDES
605
#------------------------------------------------------------------------------
606

    
607
# These options allow settings to be loaded from files other than the
608
# default postgresql.conf.
609

    
610
#include_dir = 'conf.d'			# include files ending in '.conf' from
611
					# directory 'conf.d'
612
#include_if_exists = 'exists.conf'	# include file only if it exists
613
#include = 'special.conf'		# include file
614

    
615

    
616
#------------------------------------------------------------------------------
617
# CUSTOMIZED OPTIONS
618
#------------------------------------------------------------------------------
619

    
620
# Add settings for extensions here
(14-14/32)