postgresql.conf 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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. # FILE LOCATIONS
  34. #------------------------------------------------------------------------------
  35. # The default values of these variables are driven from the -D command-line
  36. # option or PGDATA environment variable, represented here as ConfigDir.
  37. data_directory = '/ssd/postgresql' # use data in another directory
  38. # (change requires restart)
  39. hba_file = '/etc/postgresql/9.1/main/pg_hba.conf' # host-based authentication file
  40. # (change requires restart)
  41. ident_file = '/etc/postgresql/9.1/main/pg_ident.conf' # ident configuration file
  42. # (change requires restart)
  43. # If external_pid_file is not explicitly set, no extra PID file is written.
  44. external_pid_file = '/var/run/postgresql/9.1-main.pid' # write an extra PID file
  45. # (change requires restart)
  46. #------------------------------------------------------------------------------
  47. # CONNECTIONS AND AUTHENTICATION
  48. #------------------------------------------------------------------------------
  49. # - Connection Settings -
  50. listen_addresses = '*' # what IP address(es) to listen on;
  51. # comma-separated list of addresses;
  52. # defaults to 'localhost', '*' = all
  53. # (change requires restart)
  54. port = 5432 # (change requires restart)
  55. max_connections = 2000 # (change requires restart)
  56. # Note: Increasing max_connections costs ~400 bytes of shared memory per
  57. # connection slot, plus lock space (see max_locks_per_transaction).
  58. #superuser_reserved_connections = 3 # (change requires restart)
  59. unix_socket_directory = '/var/run/postgresql' # (change requires restart)
  60. #unix_socket_group = '' # (change requires restart)
  61. #unix_socket_permissions = 0777 # begin with 0 to use octal notation
  62. # (change requires restart)
  63. #bonjour = off # advertise server via Bonjour
  64. # (change requires restart)
  65. #bonjour_name = '' # defaults to the computer name
  66. # (change requires restart)
  67. # - Security and Authentication -
  68. #authentication_timeout = 1min # 1s-600s
  69. ssl = true # (change requires restart)
  70. #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
  71. # (change requires restart)
  72. #ssl_renegotiation_limit = 512MB # amount of data between renegotiations
  73. #password_encryption = on
  74. #db_user_namespace = off
  75. # Kerberos and GSSAPI
  76. #krb_server_keyfile = ''
  77. #krb_srvname = 'postgres' # (Kerberos only)
  78. #krb_caseins_users = off
  79. # - TCP Keepalives -
  80. # see "man 7 tcp" for details
  81. #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
  82. # 0 selects the system default
  83. #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
  84. # 0 selects the system default
  85. #tcp_keepalives_count = 0 # TCP_KEEPCNT;
  86. # 0 selects the system default
  87. #------------------------------------------------------------------------------
  88. # RESOURCE USAGE (except WAL)
  89. #------------------------------------------------------------------------------
  90. # - Memory -
  91. shared_buffers = 32MB # min 128kB
  92. # (change requires restart)
  93. #temp_buffers = 8MB # min 800kB
  94. #max_prepared_transactions = 0 # zero disables the feature
  95. # (change requires restart)
  96. # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
  97. # per transaction slot, plus lock space (see max_locks_per_transaction).
  98. # It is not advisable to set max_prepared_transactions nonzero unless you
  99. # actively intend to use prepared transactions.
  100. #work_mem = 1MB # min 64kB
  101. #maintenance_work_mem = 16MB # min 1MB
  102. #max_stack_depth = 2MB # min 100kB
  103. # - Kernel Resource Usage -
  104. #max_files_per_process = 1000 # min 25
  105. # (change requires restart)
  106. #shared_preload_libraries = '' # (change requires restart)
  107. # - Cost-Based Vacuum Delay -
  108. #vacuum_cost_delay = 0ms # 0-100 milliseconds
  109. #vacuum_cost_page_hit = 1 # 0-10000 credits
  110. #vacuum_cost_page_miss = 10 # 0-10000 credits
  111. #vacuum_cost_page_dirty = 20 # 0-10000 credits
  112. #vacuum_cost_limit = 200 # 1-10000 credits
  113. # - Background Writer -
  114. #bgwriter_delay = 200ms # 10-10000ms between rounds
  115. #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
  116. #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round
  117. # - Asynchronous Behavior -
  118. #effective_io_concurrency = 1 # 1-1000. 0 disables prefetching
  119. #------------------------------------------------------------------------------
  120. # WRITE AHEAD LOG
  121. #------------------------------------------------------------------------------
  122. # - Settings -
  123. #wal_level = minimal # minimal, archive, or hot_standby
  124. # (change requires restart)
  125. #fsync = on # turns forced synchronization on or off
  126. #synchronous_commit = on # synchronization level; on, off, or local
  127. #wal_sync_method = fsync # the default is the first option
  128. # supported by the operating system:
  129. # open_datasync
  130. # fdatasync (default on Linux)
  131. # fsync
  132. # fsync_writethrough
  133. # open_sync
  134. #full_page_writes = on # recover from partial page writes
  135. #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
  136. # (change requires restart)
  137. #wal_writer_delay = 200ms # 1-10000 milliseconds
  138. #commit_delay = 0 # range 0-100000, in microseconds
  139. #commit_siblings = 5 # range 1-1000
  140. # - Checkpoints -
  141. #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
  142. #checkpoint_timeout = 5min # range 30s-1h
  143. #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
  144. #checkpoint_warning = 30s # 0 disables
  145. # - Archiving -
  146. #archive_mode = off # allows archiving to be done
  147. # (change requires restart)
  148. #archive_command = '' # command to use to archive a logfile segment
  149. #archive_timeout = 0 # force a logfile segment switch after this
  150. # number of seconds; 0 disables
  151. #------------------------------------------------------------------------------
  152. # REPLICATION
  153. #------------------------------------------------------------------------------
  154. # - Master Server -
  155. # These settings are ignored on a standby server
  156. #max_wal_senders = 0 # max number of walsender processes
  157. # (change requires restart)
  158. #wal_sender_delay = 1s # walsender cycle time, 1-10000 milliseconds
  159. #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
  160. #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
  161. #replication_timeout = 60s # in milliseconds; 0 disables
  162. #synchronous_standby_names = '' # standby servers that provide sync rep
  163. # comma-separated list of application_name
  164. # from standby(s); '*' = all
  165. # - Standby Servers -
  166. # These settings are ignored on a master server
  167. #hot_standby = off # "on" allows queries during recovery
  168. # (change requires restart)
  169. #max_standby_archive_delay = 30s # max delay before canceling queries
  170. # when reading WAL from archive;
  171. # -1 allows indefinite delay
  172. #max_standby_streaming_delay = 30s # max delay before canceling queries
  173. # when reading streaming WAL;
  174. # -1 allows indefinite delay
  175. #wal_receiver_status_interval = 10s # send replies at least this often
  176. # 0 disables
  177. #hot_standby_feedback = off # send info from standby to prevent
  178. # query conflicts
  179. #------------------------------------------------------------------------------
  180. # QUERY TUNING
  181. #------------------------------------------------------------------------------
  182. # - Planner Method Configuration -
  183. #enable_bitmapscan = on
  184. #enable_hashagg = on
  185. #enable_hashjoin = on
  186. #enable_indexscan = on
  187. #enable_material = on
  188. #enable_mergejoin = on
  189. #enable_nestloop = on
  190. #enable_seqscan = on
  191. #enable_sort = on
  192. #enable_tidscan = on
  193. # - Planner Cost Constants -
  194. #seq_page_cost = 1.0 # measured on an arbitrary scale
  195. #random_page_cost = 4.0 # same scale as above
  196. #cpu_tuple_cost = 0.01 # same scale as above
  197. #cpu_index_tuple_cost = 0.005 # same scale as above
  198. #cpu_operator_cost = 0.0025 # same scale as above
  199. #effective_cache_size = 128MB
  200. # - Genetic Query Optimizer -
  201. #geqo = on
  202. #geqo_threshold = 12
  203. #geqo_effort = 5 # range 1-10
  204. #geqo_pool_size = 0 # selects default based on effort
  205. #geqo_generations = 0 # selects default based on effort
  206. #geqo_selection_bias = 2.0 # range 1.5-2.0
  207. #geqo_seed = 0.0 # range 0.0-1.0
  208. # - Other Planner Options -
  209. #default_statistics_target = 100 # range 1-10000
  210. #constraint_exclusion = partition # on, off, or partition
  211. #cursor_tuple_fraction = 0.1 # range 0.0-1.0
  212. #from_collapse_limit = 8
  213. #join_collapse_limit = 8 # 1 disables collapsing of explicit
  214. # JOIN clauses
  215. #------------------------------------------------------------------------------
  216. # ERROR REPORTING AND LOGGING
  217. #------------------------------------------------------------------------------
  218. # - Where to Log -
  219. #log_destination = 'stderr' # Valid values are combinations of
  220. # stderr, csvlog, syslog, and eventlog,
  221. # depending on platform. csvlog
  222. # requires logging_collector to be on.
  223. # This is used when logging to stderr:
  224. #logging_collector = off # Enable capturing of stderr and csvlog
  225. # into log files. Required to be on for
  226. # csvlogs.
  227. # (change requires restart)
  228. # These are only used if logging_collector is on:
  229. #log_directory = 'pg_log' # directory where log files are written,
  230. # can be absolute or relative to PGDATA
  231. #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
  232. # can include strftime() escapes
  233. #log_file_mode = 0600 # creation mode for log files,
  234. # begin with 0 to use octal notation
  235. #log_truncate_on_rotation = off # If on, an existing log file with the
  236. # same name as the new log file will be
  237. # truncated rather than appended to.
  238. # But such truncation only occurs on
  239. # time-driven rotation, not on restarts
  240. # or size-driven rotation. Default is
  241. # off, meaning append to existing files
  242. # in all cases.
  243. #log_rotation_age = 1d # Automatic rotation of logfiles will
  244. # happen after that time. 0 disables.
  245. #log_rotation_size = 10MB # Automatic rotation of logfiles will
  246. # happen after that much log output.
  247. # 0 disables.
  248. # These are relevant when logging to syslog:
  249. #syslog_facility = 'LOCAL0'
  250. #syslog_ident = 'postgres'
  251. #silent_mode = off # Run server silently.
  252. # DO NOT USE without syslog or
  253. # logging_collector
  254. # (change requires restart)
  255. # - When to Log -
  256. #client_min_messages = notice # values in order of decreasing detail:
  257. # debug5
  258. # debug4
  259. # debug3
  260. # debug2
  261. # debug1
  262. # log
  263. # notice
  264. # warning
  265. # error
  266. #log_min_messages = warning # values in order of decreasing detail:
  267. # debug5
  268. # debug4
  269. # debug3
  270. # debug2
  271. # debug1
  272. # info
  273. # notice
  274. # warning
  275. # error
  276. # log
  277. # fatal
  278. # panic
  279. #log_min_error_statement = error # values in order of decreasing detail:
  280. # debug5
  281. # debug4
  282. # debug3
  283. # debug2
  284. # debug1
  285. # info
  286. # notice
  287. # warning
  288. # error
  289. # log
  290. # fatal
  291. # panic (effectively off)
  292. #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
  293. # and their durations, > 0 logs only
  294. # statements running at least this number
  295. # of milliseconds
  296. # - What to Log -
  297. #debug_print_parse = off
  298. #debug_print_rewritten = off
  299. #debug_print_plan = off
  300. #debug_pretty_print = on
  301. #log_checkpoints = off
  302. #log_connections = off
  303. #log_disconnections = off
  304. #log_duration = off
  305. #log_error_verbosity = default # terse, default, or verbose messages
  306. #log_hostname = off
  307. log_line_prefix = '%t ' # special values:
  308. # %a = application name
  309. # %u = user name
  310. # %d = database name
  311. # %r = remote host and port
  312. # %h = remote host
  313. # %p = process ID
  314. # %t = timestamp without milliseconds
  315. # %m = timestamp with milliseconds
  316. # %i = command tag
  317. # %e = SQL state
  318. # %c = session ID
  319. # %l = session line number
  320. # %s = session start timestamp
  321. # %v = virtual transaction ID
  322. # %x = transaction ID (0 if none)
  323. # %q = stop here in non-session
  324. # processes
  325. # %% = '%'
  326. # e.g. '<%u%%%d> '
  327. #log_lock_waits = off # log lock waits >= deadlock_timeout
  328. #log_statement = 'none' # none, ddl, mod, all
  329. #log_temp_files = -1 # log temporary files equal or larger
  330. # than the specified size in kilobytes;
  331. # -1 disables, 0 logs all temp files
  332. #log_timezone = '(defaults to server environment setting)'
  333. #------------------------------------------------------------------------------
  334. # RUNTIME STATISTICS
  335. #------------------------------------------------------------------------------
  336. # - Query/Index Statistics Collector -
  337. #track_activities = on
  338. #track_counts = on
  339. #track_functions = none # none, pl, all
  340. #track_activity_query_size = 1024 # (change requires restart)
  341. #update_process_title = on
  342. #stats_temp_directory = 'pg_stat_tmp'
  343. # - Statistics Monitoring -
  344. #log_parser_stats = off
  345. #log_planner_stats = off
  346. #log_executor_stats = off
  347. #log_statement_stats = off
  348. #------------------------------------------------------------------------------
  349. # AUTOVACUUM PARAMETERS
  350. #------------------------------------------------------------------------------
  351. #autovacuum = on # Enable autovacuum subprocess? 'on'
  352. # requires track_counts to also be on.
  353. #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
  354. # their durations, > 0 logs only
  355. # actions running at least this number
  356. # of milliseconds.
  357. #autovacuum_max_workers = 3 # max number of autovacuum subprocesses
  358. # (change requires restart)
  359. #autovacuum_naptime = 1min # time between autovacuum runs
  360. #autovacuum_vacuum_threshold = 50 # min number of row updates before
  361. # vacuum
  362. #autovacuum_analyze_threshold = 50 # min number of row updates before
  363. # analyze
  364. #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
  365. #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
  366. #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
  367. # (change requires restart)
  368. #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
  369. # autovacuum, in milliseconds;
  370. # -1 means use vacuum_cost_delay
  371. #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
  372. # autovacuum, -1 means use
  373. # vacuum_cost_limit
  374. #------------------------------------------------------------------------------
  375. # CLIENT CONNECTION DEFAULTS
  376. #------------------------------------------------------------------------------
  377. # - Statement Behavior -
  378. #search_path = '"$user",public' # schema names
  379. #default_tablespace = '' # a tablespace name, '' uses the default
  380. #temp_tablespaces = '' # a list of tablespace names, '' uses
  381. # only default tablespace
  382. #check_function_bodies = on
  383. #default_transaction_isolation = 'read committed'
  384. #default_transaction_read_only = off
  385. #default_transaction_deferrable = off
  386. #session_replication_role = 'origin'
  387. #statement_timeout = 0 # in milliseconds, 0 is disabled
  388. #vacuum_freeze_min_age = 50000000
  389. #vacuum_freeze_table_age = 150000000
  390. #bytea_output = 'hex' # hex, escape
  391. #xmlbinary = 'base64'
  392. #xmloption = 'content'
  393. # - Locale and Formatting -
  394. datestyle = 'iso, mdy'
  395. #intervalstyle = 'postgres'
  396. #timezone = '(defaults to server environment setting)'
  397. #timezone_abbreviations = 'Default' # Select the set of available time zone
  398. # abbreviations. Currently, there are
  399. # Default
  400. # Australia
  401. # India
  402. # You can create your own file in
  403. # share/timezonesets/.
  404. #extra_float_digits = 0 # min -15, max 3
  405. #client_encoding = sql_ascii # actually, defaults to database
  406. # encoding
  407. # These settings are initialized by initdb, but they can be changed.
  408. lc_messages = 'en_US.UTF-8' # locale for system error message
  409. # strings
  410. lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
  411. lc_numeric = 'en_US.UTF-8' # locale for number formatting
  412. lc_time = 'en_US.UTF-8' # locale for time formatting
  413. # default configuration for text search
  414. default_text_search_config = 'pg_catalog.english'
  415. # - Other Defaults -
  416. #dynamic_library_path = '$libdir'
  417. #local_preload_libraries = ''
  418. #------------------------------------------------------------------------------
  419. # LOCK MANAGEMENT
  420. #------------------------------------------------------------------------------
  421. #deadlock_timeout = 1s
  422. #max_locks_per_transaction = 64 # min 10
  423. # (change requires restart)
  424. # Note: Each lock table slot uses ~270 bytes of shared memory, and there are
  425. # max_locks_per_transaction * (max_connections + max_prepared_transactions)
  426. # lock table slots.
  427. max_pred_locks_per_transaction = 256 # min 10
  428. # (change requires restart)
  429. #------------------------------------------------------------------------------
  430. # VERSION/PLATFORM COMPATIBILITY
  431. #------------------------------------------------------------------------------
  432. # - Previous PostgreSQL Versions -
  433. #array_nulls = on
  434. #backslash_quote = safe_encoding # on, off, or safe_encoding
  435. #default_with_oids = off
  436. #escape_string_warning = on
  437. #lo_compat_privileges = off
  438. #quote_all_identifiers = off
  439. #sql_inheritance = on
  440. #standard_conforming_strings = on
  441. #synchronize_seqscans = on
  442. # - Other Platforms and Clients -
  443. #transform_null_equals = off
  444. #------------------------------------------------------------------------------
  445. # ERROR HANDLING
  446. #------------------------------------------------------------------------------
  447. #exit_on_error = off # terminate session on any error?
  448. #restart_after_crash = on # reinitialize after backend crash?
  449. #------------------------------------------------------------------------------
  450. # CUSTOMIZED OPTIONS
  451. #------------------------------------------------------------------------------
  452. #custom_variable_classes = '' # list of custom variable class names